Android – Tesseract example

I found good tutorial on how to implement tessaract. It is writter by Iuliia Ashomok
One problem with her code was no mention about Runtime Permissions. I am making this post as note for myself. If you are reading this, not only for me.

two


GeSHi Error: GeSHi could not find the language lang (using path /home/joerichard/domains/joerichard.net/public_html/wp-content/plugins/codecolorer/lib/geshi/) (code 2)

MyApplication.java

package ru.immo.tesseractsandbox;

import android.app.Application;

import com.karumi.dexter.Dexter;

public class MyApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        Dexter.initialize(getApplicationContext());
    }

}

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
   package="ru.immo.tesseractsandbox">

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <application
       android:name=".MyApplication"
       android:allowBackup="true"
       android:icon="@mipmap/ic_launcher"
       android:label="@string/app_name"
       android:supportsRtl="true"
       android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

And do not forget add eng.traineddata to assets/tessdata and two.jpg to assets/images folder.

two.jpg
two

Run and have a fun!