Code example for Camera

Methods: getParameterssetParameterssetPreviewDisplay

0
	{ 
		// This method is called when the surface changes, e.g. when it's size 
		// is set. 
		// We use the opportunity to initialize the camera preview display 
		// dimensions. 
		Camera.Parameters p = camera.getParameters();
		p.setPreviewSize(width, height);
		camera.setParameters(p);
 
		// We also assign the preview display to this surface... 
		try { 
			camera.setPreviewDisplay(holder);
		} catch (IOException e) {
			e.printStackTrace();
		} 
	} 
 
	public void surfaceDestroyed(SurfaceHolder holder)
	{ 
		// Once the surface gets destroyed, we stop the preview mode and release 
		// the whole camera since we no longer need it.