Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
257 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 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...