Code example for Camera.Parameters

Methods: getPreviewSize, setPreviewSize

0
//			List<Size> previewSizes = mCamera.getParameters().getSupportedPreviewSizes(); 
//			Size size = previewSizes.get(previewSizes.size()-1); 
//			mParameters.setPreviewSize(size.width, size.height); 
			 
			if (initWidth != -1 && initHeight != -1) {
				mParameters.setPreviewSize(initWidth, initHeight);
				mCamera.setParameters(mParameters);
			} 
			mPreviewSize = mParameters.getPreviewSize();
			 
			// start camera preview 
			mCamera.startPreview();
        } catch (IOException exception) {  
            mCamera.release();  
            mCamera = null;  
            // TODO: add more exception handling logic here   
        }   
    } 
     
    public void setPreviewSize(int width, int height) {
    	if (mPreviewSize == null || mCamera == null) {