I'd like my app to run on both Android versions 2.1 and 2.2. In one area of my app, there is a portrait-style camera - the process for producing a portrait camera preview is different (as far as I know) on the two OS versions. Here is how:
2.1:
Camera.Parameters parameters = camera.getParameters();
parameters.set("orientation", "portrait");
camera.setParameters(parameters);
2.2:
camera.setDisplayOrientation(90);
the setDisplayOrientation(int) method became available in API Level 8 (2.2) and, so, cannot be used on 2.1; however, using the 2.1 (Camera.Parameters) method does not rotate the preview and image correctly on 2.2.
It seems odd that this incompatibility exists - is there a more correct way to do this that will allow me to target both platforms?