I have runned some samples on LG Optimus
p500 with success.
All i remember doing was commenting the code like this:
public void setPreview() throws IOException {
//if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
//mCamera.setPreviewTexture( new SurfaceTexture(10) );
//else
mCamera.setPreviewDisplay(null);
}
Choosing the appropriate target Android SDK version supported by your phone.
And going to SampleViewBase.java and selecting camera sizes that my phone supported.
You can do that by playing around with this code:
//method setupCamera @ SampleViewBase.java
Camera.Parameters params = mCamera.getParameters();
List<Camera.Size> sizes = params.getSupportedPreviewSizes();
//(...)
// This will print to logcat everything your camera supports, including preview sizes.
Log.d(TAG, "Camera flatten: "+params.flatten());
// this will also print the preview sizes
Log.d(TAG, "Camera sizes: "+ sizes.toString());
//(...)
// This will hardcode the size that can be found in 'position' - up to you to make this value dynamic if you want.
mFrameWidth = (int) sizes.get(position).width;
mFrameHeight = (int) sizes.get(position).height;