Code example for Camera

Methods: getParameterssetDisplayOrientationsetParameters

0
	  */ 
	private void setCameraDisplayOrientation() { 
		// Set the orientation of the picture on old Android phones 
		Camera.Parameters parameters = mCamera.getParameters();
 
		if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
			parameters.set("orientation", "portrait");
			// default camera orientation on android is landscape 
			// So we need to rotate the preview 
			parameters.setRotation(90);
			mCamera.setDisplayOrientation(90);
		} else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
			parameters.set("orientation", "landscape");
			parameters.setRotation(0);
			mCamera.setDisplayOrientation(0);
		} 
		mCamera.setParameters(parameters);
	} 
 
	 /** 
	  * the function that is called by the system when the preview is destroyed 
	  */ 
	 @Override 
	public void surfaceDestroyed(SurfaceHolder holder)