protected Camera openCamera() throws CameraAccessException, IOException
    {
        Camera camera = Camera.open();

        if (camera == null)
        {
            throw new CameraAccessException(CameraAccessException.CAMERA_ERROR);
        }
        Camera.Parameters params = camera.getParameters();

        params.setPreviewSize(mWidth, mHeight);
        params.setPreviewFormat(ImageFormat.NV21);
        params.setPreviewFpsRange(30000, 30000);
        camera.setParameters(params);
        camera.setPreviewCallback(new Camera.PreviewCallback()
          {
              public void onPreviewFrame(byte[] data, Camera camera)
              {
                  setImageData(data);
              }
          });
        return camera;
    }
protected Camera openCamera ( ) throws CameraAccessException , IOException { Camera camera = Camera . open ( ) ; if ( camera == null ) { throw new CameraAccessException ( CameraAccessException . CAMERA_ERROR ) ; } Camera . Parameters params = camera . getParameters ( ) ; params . setPreviewSize ( mWidth , mHeight ) ; params . setPreviewFormat ( ImageFormat . NV21 ) ; params . setPreviewFpsRange ( 30000 , 30000 ) ; camera . setParameters ( params ) ; camera . setPreviewCallback ( new Camera . PreviewCallback ( ) { public void onPreviewFrame ( byte [ ] data , Camera camera ) { setImageData ( data ) ; } } ) ; return camera ; }
Opens the camera and starts capturing images.
<p>
The default implementation uses <i>ImageFormat.NV21</i>
and tracks at 30fps. It captures 1280 x 960 images.
The width and height is obtained from mWidth and mHeight
so constructors may set this to change the image size.
@return
@throws CameraAccessException
@throws IOException