开发者

How to use Camera to take picture in a background Service on Android? [duplicate]

This question already has answers here: 开发者_运维知识库 Taking picture from camera without preview (9 answers) Closed 6 years ago.

I'm developing a Service, running in background, that uploads succesfully images and data to the web.

Now I want to upload an image taken by the Camera.

Is it possible to use the camera in a background service without preview on Android 2.2?

I found various contrastants answers on web...

How can I do it?


You can take pictures without preview with an dummy view.

like:

SurfaceView view = new SurfaceView(this);
c.setPreviewDisplay(view.getHolder());
c.startPreview();
c.takePicture(shutterCallback, rawPictureCallback, jpegPictureCallback);


It's not possible without the preview / surface view.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜