Android Camera Orientation For Newbie
I am working with a camera and facing problem in camera orientation. I have found some answer over internet and I think this answer might be best fit for me. Can anybody give me de
Solution 1:
In order to fix your camera's orientation changed your surfaceCreated function to rotate the camera from the default android camera default of landscape mode to portait mode (because your activity is in portrait mode):
@OverridepublicvoidsurfaceCreated(SurfaceHolder holder) {
camera = Camera.open();
Parametersparameters= camera.getParameters();
camera.setDisplayOrientation(90);
camera.setParameters(parameters);
}
Your app also crashes when you try and take a picture... but that is not the issue at hand... though it might have to do with you needing to add the following line to your manifest:
<uses-permissionandroid:name="android.permission.WRITE_EXTERNAL_STORAGE" />:)
Post a Comment for "Android Camera Orientation For Newbie"