我的照相机
我的照相机 http://developer.android.com/guide/topics/media/camera.html Building a Camera App
|
步骤: 1、Detecting camera hardware 检测camera硬件,需要权限 Android 2.3 (API Level 9) 选择检测有几个摄像头: Camera.getNumberOfCameras() 2、Accessing cameras 使用cameraAndroid 2.3 (API Level 9) or higher , Camera.open(int)多个摄像头,打开指定的摄像头 3、Checking camera features 获取camera的配置信息 Camera.getParameters(),Android 2.3 (API Level 9) or higher,When using API Level 9 or higher, use the Camera.getCameraInfo() to determine if a camera is on the front or back of the device, and the orientation of the image. 4、Creating a preview class 创建一个预览类 5、Placing preview in a layout 设置布局 android:screenOrientation="landscape" 水平朝向 6、Capturing pictures 照相片 7、Manifest Declarations 权限 <uses-permission android:name="android.permission.CAMERA" /> <uses-feature android:name="android.hardware.camera" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> |
|