Code example for Camera

Methods: getParameterssetParameterssetPreviewDisplaystartPreviewstopPreview

0
          return; 
        } 
 
        // stop preview before making changes 
        try { 
            mCamera.stopPreview();
        } catch (Exception e){
          // ignore: tried to stop a non-existent preview 
        } 
 
        // set preview size and make any resize, rotate or 
        // reformatting changes here 
		Parameters parameters = mCamera.getParameters();
    	parameters.setPreviewSize(1280, 720);
    	parameters.setPictureSize(1280, 720);
    	parameters.setWhiteBalance(Camera.Parameters.WHITE_BALANCE_AUTO);
 
    	Log.d("Video","White Balance: "+parameters.getWhiteBalance());
    	Log.d("Video","Flash: "+parameters.getFlashMode());
    	Log.d("Video","Exposure: "+parameters.getExposureCompensation());
    	Log.d("Video","ColorEffect: "+parameters.getColorEffect());
    	Log.d("Video","SceneMode: "+parameters.getSceneMode());
 
 
    
		mCamera.setParameters(parameters);
		 
		 
         
         
 
        // start preview with new settings 
        try { 
            mCamera.setPreviewDisplay(mHolder);
            mCamera.startPreview();
 
        } catch (Exception e){
            Log.d(TAG, "Error starting camera preview: " + e.getMessage());
        } 
    }