Has anyone come across a strange behaviour with the Camera API when used on Sony-Ericsson X10 or Droid?
For example the following code doesn't work on those devices. As a result I'm getting a lot of negative feedback on the Market translating into many cancelled orders...
mParameters.set("rotation", orientation);
mParameters.set("jpeg-quality", img_quality);
mParameters.set("picture-size", "1024x768");
mCamera.setParameters(mParameters);
Could you suggest an alternative way of achieving the same? Thanks.
You can't just set random values in the camera parameters because you don't know if the hardware is going to support that, so you need to ask first!
mCamera = Camera.open();
Camera.Parameters params = mCamera.getParameters();
List<Size> sizes = params.getSupportedPictureSizes();
// See which sizes the camera supports and choose one of those
mSize = sizes.get(0);
params.setPictureSize(mSize.width, mSize.height);
mCamera.setParameters(params);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With