其中Android相机API应该在新的项目中使用? [英] Which Android Camera API should a new project use?
问题描述
我正在开发一个新的应用程序,我要支持回果冻豆/冰淇淋三明治的所有道路。我需要使用摄像机在我的应用程序 - 只是拍摄一些15秒画面和没有处理
I am developing a new app, and I want to support all the way back to Jelly Bean/Ice Cream Sandwich. I need to use the video camera in my app - just to shoot some 15 second footage and no processing.
我必须写两个摄像头活动,其中一个摄像头API和其他与摄像机2 API,总得挑基于设备的API级别的?
Do I have to write two camera Activities, one with the camera api and the other with the camera2 api, and somehow pick one based on the api level of the device?
或者,我应该只是用相机API?
Or, should I just use the camera api?
你会用哪个摄像头API,如果你今天开发一个新的相机基于应用程序?
Which camera api would you use if you were developing a new camera based app today?
谢谢!
标记
推荐答案
首先,你需要决定你是否真的想建立一个定制的相机应用,也可以使用现有的相机应用。从你的问题,我觉得你的是后一种情况下,你可以简单地使用意图调用现有的Android摄像头应用程序。
First of all, you need to decide whether you really want to build a customized camera app, or you can use an existing camera app. From your question, I feel that yours is the latter case, and you can simply use an intent to invoke an existing Android camera application.
https://developer.android.com/guide/topics/媒体/ camera.html#意图
如果你真的想建立自己的定制相机应用,我建议你参考此链接:
If you really want to build your own customized camera app, I suggest that you refer this link:
的http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels
和阅读以下部分:
应用向前兼容性结果
应用向后兼容性结果
选择一个平台版本和API等级
Application forward compatibility
Application backward compatibility
Selecting a platform version and API Level
这篇关于其中Android相机API应该在新的项目中使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!