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" />
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容