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...
mParame开发者_C百科ters.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);
You must first fix the orientation of the activity and then must put orietación grades:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
mCamera.setDisplayOrientation(90);
精彩评论