1<?xml version="1.0" encoding="UTF-8"?> 2<!-- 3 Copyright 2013 The Android Open Source Project 4 5 Licensed under the Apache License, Version 2.0 (the "License"); 6 you may not use this file except in compliance with the License. 7 You may obtain a copy of the License at 8 9 http://www.apache.org/licenses/LICENSE-2.0 10 11 Unless required by applicable law or agreed to in writing, software 12 distributed under the License is distributed on an "AS IS" BASIS, 13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 See the License for the specific language governing permissions and 15 limitations under the License. 16--> 17<sample> 18 <name>MediaRecorder</name> 19 <group>Media</group> 20 <package>com.example.android.mediarecorder</package> 21 <minSdk>16</minSdk> 22 <strings> 23 <intro> 24<![CDATA[ 25This sample uses the camera/camcorder as the A/V source for the MediaRecorder API. 26A TextureView is used as the camera preview which limits the code to API 14+. This 27can be easily replaced with a SurfaceView to run on older devices. 28]]> 29 </intro> 30 </strings> 31 <template src="base"/> 32 <common src="media"/> 33 <metadata> 34 <status>PUBLISHED</status> 35 <categories>Media</categories> 36 <technologies>Android</technologies> 37 <languages>Java</languages> 38 <solutions>Mobile</solutions> 39 <level>ADVANCED</level> 40 <icon>screenshots/big_icon.png</icon> 41 <screenshots> 42 <img>screenshots/screenshot1.png</img> 43 <img>screenshots/screenshot2.png</img> 44 </screenshots> 45 <api_refs> 46 <android>android.hardware.Camera</android> 47 <android>android.media.CamcorderProfile</android> 48 <android>android.media.MediaRecorder</android> 49 <android>android.view.TextureView</android> 50 </api_refs> 51 <description> 52<![CDATA[ 53This sample uses the camera/camcorder as the A/V source for the MediaRecorder API. 54A TextureView is used as the camera preview which limits the code to API 14+. This 55can be easily replaced with a SurfaceView to run on older devices. 56]]> 57 </description> 58 <intro> 59<![CDATA[ 60This sample shows how to use the [MediaRecorder][1] API. 61It uses the [Camera][2] as input source and displays a preview on a [TextureView][3] 62The sample features a button to capture the input and stop capturing afterwards. 63 64It demonstrates how to correctly gain control and release the camera. 65The sample also shows how to save the captured audio and video to persistant storage 66and basic error handling. 67 68 69[1]: https://developer.android.com/reference/android/media/MediaRecorder.html 70[2]: https://developer.android.com/reference/android/graphics/Camera.html 71[3]: https://developer.android.com/reference/android/view/TextureView.html 72]]> 73 </intro> 74 </metadata> 75</sample> 76