How to capture images in background using Camera2 api?

南笙酒味 提交于 2019-12-08 05:36:03

问题


I am developing an Android security app, and I want to capture images in background without preview. Is it possible to capture images in the background using the camera2 api?


回答1:


Yes, but as of Android 5.0 Marshmallow, you may be disconnected from the camera at any time, if a foreground app wants to use it instead.

And before Android M, using the camera from the background is not recommended, since you'll block any foreground app from using it (the app will just get an error trying to open the camera, and generally will crash as a result).

Otherwise, the camera API works the same. You'll need to run the camera for a few seconds before taking the final picture to ensure metering and focus are generally good, though exactly what you need would depend highly on the details of your use case.



来源:https://stackoverflow.com/questions/36770168/how-to-capture-images-in-background-using-camera2-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!