I would like to take a picture without any preview. I used this code but I\'m getting an error:
public void onCreate(Bundle savedInstanceState) {
super.
Regarding your Fail to initialize camera
error, another possibility is the camera is in use by something else.
Android can't use camera without a preview... but, you can set the preview size like 1x1 px, then you won't see it and you can use the camera anyway.
Use this permissions :
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
And you can instantiate a Camera object using this
Camera mycamera = Camera.open();
You can try the method described here is very simple if you are into simplicity:
http://developer.android.com/training/camera/photobasics.html