Wiki
Clone wikilexicon / WithoutOCR
No Tesseract dependency
If you want to build the application without OCR functionality, follow the steps bellow. By using the OCR libraries you will use ~ 9 MB more plus ~ 1 MB OCR test data for each installed dictionary. Vice versa is also true.
- Open AndroidManifest.xml and remove uses-library = com.googlecode.tesseract.android
- Open Main.java source file and remove/comment the following line:
import com.googlecode.tesseract.android.TessBaseAPI;
private String getTextFromOCRBitmap(Bitmap bitmap) {
return null;
/*
String lang = currentDictionary == null || currentDictionary.source_language.length() == 0 ? "eng": currentDictionary.source_language;
TessBaseAPI baseApi = new TessBaseAPI();
baseApi.init(Utils.getDbDirectory(this), lang);
baseApi.setImage(bitmap);
String recognizedText = baseApi.getUTF8Text();
baseApi.end();
return recognizedText;
*/
}
- Open the res/menu/mainmenu.xml, search for '@+id/item_ocr' item and add the following property: android:visible="false"
- Open the file lexicon/project.properties and remove the refference to the tess-two project:
android.library.reference.1=<path-to-tess>/tess-two/tess-two
That should be all!
Updated