Code example for Camera.Parameters

Methods: getSupportedPreviewSizes, setPreviewSize

0
		if(portrait) {
			camera.setDisplayOrientation(90);
		}else{ 
			camera.setDisplayOrientation(0);
		} 
		List<Size> sizeList = parameters.getSupportedPreviewSizes();
		Size size = sizeList.get(3);
		parameters.setPreviewSize(size.width, size.height); // Default:2048x1536
		//parameters.setPreviewSize(width, height); 
		camera.setParameters(parameters);
		camera.startPreview();
	} 
 
	protected boolean isPortrait() { 
	    return (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT);
	} 
	 
	@Override 
	public boolean onTouchEvent(MotionEvent e) {
		if (e.getAction() == MotionEvent.ACTION_DOWN) {
Stop searching for code, let great code find you!  Add Codota to your java IDE