android camera in background

最后都变了- 提交于 2019-11-27 07:22:50

问题


I am developing an application to take images from background application say using android service. i don't want any user interaction to takes images, it should completely work from background.

I have already tried -

  1. Calling camera from service - It not always works sometime works if we have dummy surfaceview, again if Android close the related activity service stopped takings pics, I don't want to run activity for user interaction. with some changes it working fine but all images are black.
  2. Widget: Not getting how to call camera in widget as widget doesn't support surfaceview.
  3. Live wallpaper: not able to make it work till now, does it supports for camera?

As per my experience till now Android camera service not designed to takes picture if no real preview available.

Is anyone developed something like this? any help will be really appreciate.


回答1:


If you can ignore older versions, it may be easier to use SurfaceTexture (API 11 and higher) As vikky.rk notes in an answer to a recent question, an introduction to this technique can be found in the PanoramaActivity code of the default Android Camera App.



来源:https://stackoverflow.com/questions/11097178/android-camera-in-background

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