This issue appeared to start out as a bug with certain hardware see here but can be overcome by using the call to mCamera. SetDisplayOrientation(degrees) available in API 8. So this is how I implement it: public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { if (isPreviewRunning) { mCamera.stopPreview(); } Parameters parameters = mCamera.getParameters(); Display display = ((WindowManager)getSystemService(WINDOW_SERVICE)).
GetDefaultDisplay(); if(display.getRotation() == Surface. ROTATION_0) { parameters. SetPreviewSize(height, width); mCamera.
SetDisplayOrientation(90); } if(display.getRotation() == Surface. ROTATION_90) { parameters. SetPreviewSize(width, height); } if(display.getRotation() == Surface.
ROTATION_180) { parameters. SetPreviewSize(height, width); } if(display.getRotation() == Surface. ROTATION_270) { parameters.
SetPreviewSize(width, height); mCamera. SetDisplayOrientation(180); } mCamera. SetParameters(parameters); previewCamera(); } And the previewCamera method : public void previewCamera() { try { mCamera.
SetPreviewDisplay(mSurfaceHolder); mCamera.startPreview(); isPreviewRunning = true; } catch(Exception e) { Log. D(APP_CLASS, "Cannot start preview", e); } } This was on an HTC Desire and I had to initially put in logging statements in each of the rotation checks to say what the rotation was and then debugged on the device and watched the logCat output while I rotated the device. For the HTC Desire, 0 was the phone as you would have expected (portrait), 90 degrees was turning the phone 90 degrees COUNTER-CLOCKWISE (I had assumed it would have been clockwise).
In the code you'll see I didn't need to do any display rotation when the phone was at 90 or 180 degrees - the device seemed to handle this itself. Only one point not working properly: The 270 degree rotation is when you turn the device 90 degrees clockwise and the display rotation counters that ok but if you rotate the device 270 degrees counter-clockwise, it doesn't appear to compensate it properly P.S. Note the swapover of width and height in the appropriate rotations.
This issue appeared to start out as a bug with certain hardware see here but can be overcome by using the call to mCamera. SetDisplayOrientation(degrees) available in API 8. So this is how I implement it: public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { if (isPreviewRunning) { mCamera.stopPreview(); } Parameters parameters = mCamera.getParameters(); Display display = ((WindowManager)getSystemService(WINDOW_SERVICE)).
GetDefaultDisplay(); if(display.getRotation() == Surface. ROTATION_0) { parameters. SetPreviewSize(height, width); mCamera.
SetDisplayOrientation(90); } if(display.getRotation() == Surface. ROTATION_90) { parameters. SetPreviewSize(width, height); } if(display.getRotation() == Surface.
ROTATION_180) { parameters. SetPreviewSize(height, width); } if(display.getRotation() == Surface. ROTATION_270) { parameters.
SetPreviewSize(width, height); mCamera. SetDisplayOrientation(180); } mCamera. SetParameters(parameters); previewCamera(); } And the previewCamera method : public void previewCamera() { try { mCamera.
SetPreviewDisplay(mSurfaceHolder); mCamera.startPreview(); isPreviewRunning = true; } catch(Exception e) { Log. D(APP_CLASS, "Cannot start preview", e); } } This was on an HTC Desire and I had to initially put in logging statements in each of the rotation checks to say what the rotation was and then debugged on the device and watched the logCat output while I rotated the device. For the HTC Desire, 0 was the phone as you would have expected (portrait), 90 degrees was turning the phone 90 degrees COUNTER-CLOCKWISE (I had assumed it would have been clockwise).
In the code you'll see I didn't need to do any display rotation when the phone was at 90 or 180 degrees - the device seemed to handle this itself. Only one point not working properly: The 270 degree rotation is when you turn the device 90 degrees clockwise and the display rotation counters that ok but if you rotate the device 270 degrees counter-clockwise, it doesn't appear to compensate it properly. P.S.Note the swapover of width and height in the appropriate rotations.
Parameters. SetRotation(90); parameters. Set("orientation", "portrait"); are not working.
If you have any solution for lower versions please help me. – Vikram Nov 1 at 15:11.
This issue appeared to start out as a bug with certain hardware see here but can be overcome by using the call to mCamera. SetDisplayOrientation(degrees) available in API 8. This was on an HTC Desire and I had to initially put in logging statements in each of the rotation checks to say what the rotation was and then debugged on the device and watched the logCat output while I rotated the device.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.