Code example for Camera.Parameters

Methods: getPictureSize, getSupportedPreviewSizes, setPreviewSize

0
			// .getSupportedPreviewSizes().get(0).height); 
			myCamera.setParameters(p);
			myCamera.setPreviewDisplay(holder);
			myCamera.startPreview();
			System.out.println("startPreview"
					+ p.getSupportedPreviewSizes().get(3).width + " "
					+ p.getSupportedPreviewSizes().get(0).height);
			myCamera.autoFocus(null);
			myPreviewRunning = true;
		} catch (Exception e) {
			Log.e("ERROR", e.getMessage());
		} 
	} 
 
	private void setPreviewResolution(Parameters p) {
		int maxWidth = 0;
		int maxHeight = 0;
		p.setPreviewSize(p.getPictureSize().width, p.getPictureSize().height);
	} 
 
	@Override 
	public void surfaceCreated(SurfaceHolder holder) {
		myCamera = Camera.open();
Stop searching for code, let great code find you!  Add Codota to your java IDE