Code example for Camera.Parameters

Methods: getSupportedPreviewSizes, setPictureFormat, setPreviewSize

0
		@SuppressWarnings("deprecation") 
		@Override 
		public void surfaceChanged(SurfaceHolder holder, int format, int width, 
				int height) { 
			Parameters mParameters = mCamera.getParameters(); 
			List<Camera.Size> mPreviewSizes = mParameters 
					.getSupportedPreviewSizes(); 
			Camera.Size mPreviewSize = mPreviewSizes.get(0); 
			if (Resources.getSystem().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) { 
				mCamera.setDisplayOrientation(90); 
			} else if (Resources.getSystem().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { 
				mCamera.setDisplayOrientation(180); 
			} 
			mParameters.setPreviewSize(mPreviewSize.width, mPreviewSize.height); 
			mParameters.setPictureFormat(PixelFormat.JPEG); 
			mCamera.setParameters(mParameters); 
			mCamera.startPreview(); 
		} 
	}; 
 
	SensorEventListener mSensorEventListener = new SensorEventListener() {