Code example for Camera

Methods: getParameterssetParameters

0
 
		@Override 
		public void onOrientationChanged(int orientation) {
			if (orientation == ORIENTATION_UNKNOWN) return;
			try{ 
				Camera.Parameters config = camera.getParameters();
				/*Camera.CameraInfo info = 
				        new Camera.CameraInfo();*/ 
				//Camera.getCameraInfo(camera, info); 
				orientation = (orientation + 45) / 90 * 90;
				int rotation = orientation % 360;
				//if (info.facing == CameraInfo.CAMERA_FACING_FRONT) { 
				    //rotation = (info.orientation - orientation + 360) % 360; 
				/*} else {  // back-facing camera 
				    rotation = (info.orientation + orientation) % 360; 
				}*/ 
				config.setRotation(rotation);
				camera.setParameters(config);
			}catch(Exception e){
				 
			} 
		}