OCRTest/src/main/java/edu/sfsu/cs/orange/ocr/CaptureActivity.java
private void initCamera(SurfaceHolder surfaceHolder) {
    Log.d(TAG, "initCamera()");
    if (surfaceHolder == null) {
      throw new IllegalStateException("No SurfaceHolder provided");
    }
    try {

      // Open and initialize the camera
      cameraManager.openDriver(surfaceHolder);

      // Creating the handler starts the preview, which can also throw a RuntimeException.
      handler = new CaptureActivityHandler(this, cameraManager, isContinuousModeActive);

    } catch (IOException ioe) {
      showErrorMessage("Could not initialize camera. Please try restarting device.");
    } catch (RuntimeException e) {
      // Barcode Scanner has seen crashes in the wild of this variety:
      // java.?lang.?RuntimeException: Fail to connect to camera service
      showErrorMessage("Could not initialize camera. Please try restarting device.");
    }
  }
/**
   * Initializes the camera and starts the handler to begin previewing.
   */
Initializes the camera and starts the handler to begin previewing.
Initializes the camera and starts the handler to begin previewing .
private void initCamera(SurfaceHolder surfaceHolder) {
    Log.d(TAG, "initCamera()");
    if (surfaceHolder == null) {
      throw new IllegalStateException("No SurfaceHolder provided");
    }
    try {
      cameraManager.openDriver(surfaceHolder);
      handler = new CaptureActivityHandler(this, cameraManager, isContinuousModeActive);
    } catch (IOException ioe) {
      showErrorMessage("Could not initialize camera. Please try restarting device.");
    } catch (RuntimeException e) {
      showErrorMessage("Could not initialize camera. Please try restarting device.");
    }
  }
private void initCamera ( SurfaceHolder surfaceHolder ) { Log . d ( TAG , "initCamera()" ) ; if ( surfaceHolder == null ) { throw new IllegalStateException ( "No SurfaceHolder provided" ) ; } try { cameraManager . openDriver ( surfaceHolder ) ; handler = new CaptureActivityHandler ( this , cameraManager , isContinuousModeActive ) ; } catch ( IOException ioe ) { showErrorMessage ( "Could not initialize camera. Please try restarting device." ) ; } catch ( RuntimeException e ) { showErrorMessage ( "Could not initialize camera. Please try restarting device." ) ; } }
Initializes the camera and starts the handler to begin previewing.
Initializes the camera and starts the handler to begin previewing .
// Open and initialize the camera
 // Creating the handler starts the preview, which can also throw a RuntimeException.
 // Barcode Scanner has seen crashes in the wild of this variety:
 // java.?lang.?RuntimeException: Fail to connect to camera service
