Skip to content Skip to sidebar Skip to footer

Android - Take Picture Without Preview

I am trying to take a picture without preview, immediately when my application starts running and after that to save the picture in new folder - 'pictures123', in the root folder.

Solution 1:

You can't take a picture without a preview, but you don't have to show the preview on screen. You can direct the output to a SurfaceTexture instead (API 11+).

See this answer for more details.

Solution 2:

I think the main problem is that you are calling takePicture immediately after startPreview which actually takes time to complete its setup. So adding a delay between those two could temporarily fix this issue, look here for more details.

Solution 3:

It's impossible to take a picture without preview. You should read the Android online reference: http://developer.android.com/reference/android/hardware/Camera.html#takePicture.

Note: This method is only valid when preview is active (after startPreview()). Preview will be stopped after the image is taken; callers must call startPreview() again if they want to re-start preview or take more pictures. This should not be called between start() and stop().

Post a Comment for "Android - Take Picture Without Preview"