I’m following this tutorial to learn Android’s Camera API. I made it the end of the first section (right before “Providing an overlay” begins), and I’m getting the following error:
06-20 23:33:50.903: ERROR/AndroidRuntime(1114): at android.hardware.Camera.startPreview(Native Method)
06-20 23:33:50.903: ERROR/AndroidRuntime(1114): at com.sobel.Sobel.startCamera(Sobel.java:73)
06-20 23:33:50.903: ERROR/AndroidRuntime(1114): at com.sobel.Sobel.surfaceChanged(Sobel.java:36)
Git repo here. Main Activity here. Manifest here.
I checked and re-checked my code and have followed the tutorial to a t, so what could be causing this error?
Try setting the type of Surface in initCamera().
EDIT 1
I am copying all the files here which worked for me with android 2.2 sdk
Activity
}
Layout
Manifest File
Check if it still doesnt work out for you.