Code example for Camera.Parameters

Methods: getSupportedPreviewSizes, setPreviewSize

0
	@Override 
	public void surfaceChanged(SurfaceHolder holder, int format, int width,
			int height) {
		// TODO Auto-generated method stub 
		parameters = camera.getParameters();
        List<Camera.Size> previewSizes = parameters.getSupportedPreviewSizes();
        Camera.Size previewSize = previewSizes.get(0);
        //set preview size 
        parameters.setPreviewSize(previewSize.width, previewSize.height);
        //set parameter 
        camera.setParameters(parameters);
        //start preview 
        camera.startPreview();
 
        v_holder = holder;
	} 
 
	@Override 
	public void surfaceCreated(SurfaceHolder holder) {
		// TODO Auto-generated method stub 
        //open main camera