@Override
  public void handleMessage(Message message) {
    if (!running) {
      return;
    }
    switch (message.what) {        
    case R.id.ocr_continuous_decode:
      // Only request a decode if a request is not already pending.
      if (!isDecodePending) {
        isDecodePending = true;
        ocrContinuousDecode((byte[]) message.obj, message.arg1, message.arg2);
      }
      break;
    case R.id.ocr_decode:
      ocrDecode((byte[]) message.obj, message.arg1, message.arg2);
      break;
    case R.id.quit:
      running = false;
      Looper.myLooper().quit();
      break;
    }
  }
Class to send bitmap data for OCR.

The code for this class was adapted from the ZXing project: http://code.google.com/p/zxing/
OCRTest/src/main/java/edu/sfsu/cs/orange/ocr/DecodeHandler.java