Changes

Jump to: navigation, search
no edit summary
== Calling the Video Capture Intent ==
Use of the video capture intent involves, at a minimum, the implementation of code to call the intent activity and a method to handle the return from the activity. The Android buildbuilt-in video recording intent is represented by MediaStore.ACTION_VIDEO_CAPTURE and may be launched as follows:
<pre>
Create a new project in Android Studio, entering CameraApp into the Application name field and ebookfrenzy.com as the Company Domain setting before clicking on the Next button.
On the form factors screen, enable the Phone and Tablet option and set the minimum SDK setting to API 8: Android 2.2 (Froyo). Continue to proceed through the screens, requesting the creation of a blank activity named CameraAppActivity with a corresponding layout and menu resource files named activity_camera_appand menu_camera_app.
== Designing the User Interface Layout ==
Navigate to CameraApp -> app -> src -> main -> res -> layout and double click on the activity_camera_app.xml layout file to load it into the Designer tool. With the Designer tool in Design mode, delete the default “Hello world!” text view and replace it with a Button view positioned in the center of the display canvas. Change the text on the button to read “Record Video” and assign an onClick property to the button so that it calls a method named startRecording() when selected by the user:
[[Image:android_studio_camera_uiandroid_studio_camera_ui2.png|The user interface for an Android Studio camera app]]
Figure 48-2

Navigation menu