Do you know a way to take a picture without previewing? I searched and found only non-working solutions like setting the surface view width and height to 1 dp.
Asked
Active
Viewed 95 times
0
-
I am currently working on similar issue. Have you read http://developer.android.com/guide/topics/media/camera.html ? – gfrigon Oct 09 '14 at 18:29
-
As I see the guide is only for a surfaceview that is previewed. – dephinera Oct 09 '14 at 18:36
-
possible duplicate of _[Take Picture without preview android](http://stackoverflow.com/questions/10799976/take-picture-without-preview-android)_ and _[Android Camera without Preview](http://stackoverflow.com/questions/2386025/android-camera-without-preview)_ – Alex Cohn Oct 09 '14 at 19:26
1 Answers
0
You can choose not to call the following function to prevent a preview from showing.
Camera.setPreviewDisplay(holder)

Chris Stillwell
- 10,266
- 10
- 67
- 77
-
Will the camera work without being previewed? I thought Android requires a preview to use the camera. – dephinera Oct 09 '14 at 20:18
-
I tested it with an app I'm developing now (it uses the camera as a barcode scanner) and I was able to take the picture no problem. – Chris Stillwell Oct 09 '14 at 20:21
-
-
I'll give it a try tomorrow (it's pretty late here). If it works I'll mark your answer as correct. Thank you :) – dephinera Oct 09 '14 at 21:22
-
It works on the emulator but crashed when I run it on a real device. I tried it on sony xperia M – dephinera Oct 11 '14 at 13:09