• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

tess-two Android Studio app has stopped at data path

I am starting off simple with `tess-two` in `Android Studio` (after I managed to import the pre-compiled version of `Tesseract` into my project!) so I keep adding single lines and moving forward...

In `strings.xml` under `values` under `res`, I have defined the following data path:

<string name="data_path">/usr/local/Cellar/tesseract/3.05.01/share/tessdata/eng.traineddata</string>

However, the `baseApi.init` line crashes my `Empty Activity` app that would normally build to device and say `Hello World`.

What am I doing wrong?

Code:
    public class MainActivity extends AppCompatActivity
    {
        @Override
        protected void onCreate(Bundle savedInstanceState)
        {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
 
            // Attempt to initialize the API.
            TessBaseAPI baseApi = new TessBaseAPI();
 
            // Initialize the language training file path.
            // See 'strings.xml' under 'values' under 'res'.
            String DATA_PATH = getString(R.string.data_path);

            baseApi.init(DATA_PATH, "eng"); // <-- TessAndroid has stopped!
        }
    }
 
Back
Top Bottom