1. Are you ready for the Galaxy S20? Here is everything we know so far!

tess-two Android Studio app has stopped at data path

Discussion in 'Android Devices' started by Joshua Martinez, Aug 6, 2017.

  1. Joshua Martinez

    Thread Starter

    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 (Text):
    1.  
    2.     public class MainActivity extends AppCompatActivity
    3.     {
    4.         @Override
    5.         protected void onCreate(Bundle savedInstanceState)
    6.         {
    7.             super.onCreate(savedInstanceState);
    8.             setContentView(R.layout.activity_main);
    9.  
    10.             // Attempt to initialize the API.
    11.             TessBaseAPI baseApi = new TessBaseAPI();
    12.  
    13.             // Initialize the language training file path.
    14.             // See 'strings.xml' under 'values' under 'res'.
    15.             String DATA_PATH = getString(R.string.data_path);
    16.  
    17.             baseApi.init(DATA_PATH, "eng"); // <-- TessAndroid has stopped!
    18.         }
    19.     }
    20.  
     



    1. Download the Forums for Android™ app!


      Download

       

Samsung Galaxy S7 Forum

The Samsung Galaxy S7 release date was March 2016. Features and Specs include a 5.1" inch screen, 12MP camera, 4GB RAM, Exynos 8890 Octa processor, and 3000mAh battery.

March 2016
Release Date
0
Reviews
Loading...
Similar Threads - tess Android Studio
  1. Leodev
    Replies:
    1
    Views:
    144
  2. Dw1892
    Replies:
    2
    Views:
    408
  3. The_Chief
    Replies:
    4
    Views:
    381
  4. 20GT
    Replies:
    7
    Views:
    506
  5. Joshua Jackson
    Replies:
    2
    Views:
    428
  6. Veez999
    Replies:
    6
    Views:
    745
  7. Wookbert
    Replies:
    2
    Views:
    699
  8. Mr Padh
    Replies:
    4
    Views:
    484
  9. Jelyob
    Replies:
    12
    Views:
    820
  10. Md Saruar Hossain
    Replies:
    4
    Views:
    543

Share This Page

Loading...