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 
        } 
 
        // Now that the size is known, set up the camera parameters and begin 
        // the preview. 
        Camera.Parameters parameters = mCamera.getParameters();
        parameters.setPreviewSize(mPreviewSize.width, mPreviewSize.height);
        mCamera.setParameters(parameters);
        // Log.v(TAG,"Camera params:" + parameters.flatten()); 
        try { 
            mCamera.setPreviewDisplay(mHolder);
            mCamera.startPreview();
 
        } catch (Exception e){
            Log.d(TAG, "Error starting camera preview: " + e.getMessage());
        } 
    }