Code example for Camera.Parameters

Methods: setFlashMode, setRotation

0
	@TargetApi(8) 
	private Parameters setParameter(Context ctx, Parameters params) {
		WindowManager windowManager = (WindowManager) ctx.getSystemService(Context.WINDOW_SERVICE);
		int rotacion = windowManager.getDefaultDisplay().getRotation();
		// PreyLogger.d("Camera rotacion:"+rotacion+" [0->0 1->90 2-> 180 3->270]"); 
		params.setFlashMode(Parameters.FLASH_MODE_OFF);
		switch (rotacion) {
		case Surface.ROTATION_90:
			break; 
		case Surface.ROTATION_180:
			params.setRotation(270);
			break; 
		case Surface.ROTATION_270:
			params.setRotation(180);
			break; 
		default: 
			params.setRotation(90);
			break; 
		} 
 
		return params;