android可以通过Intent来调用摄像头,那样调用的系统提供的摄像头程序,如果想直接调用摄像头的硬件,也可以直接访问摄像头.
具体可以参考 http://developer.android.com/guide/topics/media/camera.html里"Building a Camera App"这一节
关键的两个步骤是
创建SurfaceView用来绘制摄像头的预览
创建layout确定SurfaceView的位置,比如在这里可以在摄像头预览上加上自己定制的组件
要注意的几点是
camera要及时的在onPause方法中release掉
activity要加上 android:screenOrientation="landscape"否则预览和实际图像往往有90度角的偏转
引用 On most devices, the default orientation of the camera preview is landscape. This example layout specifies a horizontal (landscape) layout and the code below fixes the orientation of the application to landscape. For simplicity in rendering a camera preview, you should change your application's preview activity orientation to landscape by adding the following to your manifest.


比如加上瞄准镜的效果
android直接调用摄像头

更多相关文章

  1. Android官方架构组件:Lifecycle详解&原理分析
  2. Android 之 下拉(Spinner) 组件示例
  3. Android之四大组件解析
  4. android 3D摄像头的扩展现实
  5. Intent组件构成,解析机制
  6. 深入剖析Android四大组件(三)——AIDL实现Android IPC
  7. android——桌面组件的开发
  8. Android 桌面组件【widget】初探

随机推荐

  1. 基于Gradle支持Android(安卓)Studio的蒲
  2. Android资源管理框架(Asset Manager)简要介
  3. Android清除数据、清除缓存、一键清理的
  4. Android(安卓)性能优化 内存优化 How to
  5. Android(安卓)SQLiteException: near "":
  6. android之生命周期onSaveInstanceState()
  7. HTC HERO/Android(安卓)刷机+中文配置
  8. Android用户也能幸福爆棚
  9. 【翻译】在 Android(安卓)真机上运行 App
  10. Android(安卓)layout 使用include和merge