Android Camera?簡介 (2)

自己動手,豐衣食足。
需要:

Manifest declarations

Before starting development on your application with the Camera API, you should make sure your manifest has the appropriate declarations to allow use of camera hardware and other related features.

By adding camera features to your manifest causes Google Play to prevent your application from being installed to devices that do not include a camera or do not support the camera features you specify.

Camera Permission

Your application must request permission to use a device camera.

<uses-permission android:name="android.permission.CAMERA" />

Note: If you are using the camera by invoking an existing camera app, your application does not need to request this permission.

Camera Features

<uses-feature android:name="android.hardware.camera" />

For a list of camera features, see the manifest Features Reference.

Storage Permission

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

If your application saves images or videos to the device's external storage (SD Card), you must also specify this in the manifest.

Audio Recording Permission

<uses-permission android:name="android.permission.RECORD_AUDIO" />

For recording audio with video capture, your application must request the audio capture permission.

Location Permission

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<!-- Needed only if your app targets Android 5.0 (API level 21) or higher. -->
<uses-feature android:name="android.hardware.location.gps" />
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容