I'm asked to create an Android application using OCR and Zxing to scan a code bar. The result should have the "Codebar image" in an ImageView and the "scan result" and "OCR result" in the a TextView.
Could any one please explain me how to do it, as I'm new to Android development.
I have added the code below to the captureActivity of the zxing2.1. I also addes the Tess-two.jar to the Zxing. And when i executed the application stopped. can any one please tell me how to add the OCR code to zxing. Here is the code that i added to Zxing.
private void handleDecodeInternally(Result rawResult, ResultHandler resultHandler, Bitmap barcode) {
statusView.setVisibility(View.GONE);
viewfinderView.setVisibility(View.GONE);
resultView.setVisibility(View.VISIBLE);
String textocrResult;
ImageView barcodeImageView = (ImageView) findViewById(R.id.barcode_image_view);
if (barcode == null) {
barcodeImageView.setImageBitmap(BitmapFactory.decodeResource(getResources(),
R.drawable.launcher_icon));
} else {
barcodeImageView.setImageBitmap(barcode);
baseApi.setImage(ReadFile.readBitmap(barcode));
textocrResult = baseApi.getUTF8Text();
ocrResult = new OcrResult();
ocrResult.setText(textocrResult);
ocrResult.setBitmap(barcode);
TextView ocrResultTextView = (TextView) findViewById(R.id.ocr_result_text_view);
ocrResultTextView.setText(textocrResult);
}