Camera capture without preview in Android 2.2

I have a requirement to capture an image without preview. And I want to do this in the background as a service.

Can this be done?

+4
source share
1 answer

It is possible to achieve. You must define the class that processes the Camera object, as in calls to Camera.open (), etc. Do not provide the following lines to the camera object to disable the preview -

mCamera.setPreviewDisplay(mTargetHolder);

Where mTargetHolderis SurfaceView.

If you want to receive frame callbacks, you can implement the Camera.PreviewCallback interface.

, camera.startPreview(), , setPreviewCallbackWithBuffer (Camera.PreviewCallback).

, , , . , . . Camera.PictureCallback, .

, . ( )

+4

All Articles