Code example for Camera.Parameters

Methods: getSupportedPreviewSizes, setPreviewSize

	public void surfaceChanged(final SurfaceHolder pSurfaceHolder, final int pPixelFormat, final int pWidth, final int pHeight) { 
		final Parameters parameters = this.mCamera.getParameters(); 
		final List<Size> previewSizes = parameters.getSupportedPreviewSizes(); 
		// TODO Choose appropriate preview size. (Maybe try to get it as close to pWidth/pHeight as possible?) 
		final Size previewSize = previewSizes.get(0); 
		parameters.setPreviewSize(previewSize.width, previewSize.height); 
	// =========================================================== 
	// Methods 
	// =========================================================== 
Connect your IDE to all the code out there  Get Codota for Java