I need to capture characters of an image so i am using TextRecognizer
. My code is given below
TextRecognizer textRecognizer = new TextRecognizer.Builder(mActivity.getGalleryApplication().getAndroidContext()).build();
if (!textRecognizer.isOperational()) {
new AlertDialog.Builder(mActivity.getAndroidContext())
.setMessage("Text recognizer could not be set up :(").show();
return;
}
textRecognizer.release();
I have added dependencies in build.gradle as below:
dependencies {
compile 'com.google.android.gms:play-services-maps:10.2.1'
compile 'com.google.firebase:firebase-appindexing:10.2.1'
compile 'com.android.support:appcompat-v7:23.0.0'
}
Everytime I launch the apk, "Text recognizer could not be set up : is displayed. Even though I have set all dependencies but still i am getting this error. Please help why TextRecognizer.isOperational()
is always false.
I have a project to be completed by next weekend. Please help to solve this error.