Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
254 views
in Technique[技术] by (71.8m points)

android camera in background

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...