1

I am Working on Windows

I want to use the open source tess-two project for image processing in an android application - https://github.com/rmtheis/tess-two.

now, according to this tutorial - http://gaut.am/making-an-ocr-android-app-using-tesseract/ I need to build the tess-two with ndk-build.

Where I am right now:

I downloaded the ndk and run the installer, and now I have the android-ndk-r10d folder - from here https://developer.android.com/tools/sdk/ndk/index.html.

Also downloaded the zip file from https://github.com/rmtheis/tess-two extracted to a folder .

My question is -

  1. Do I need anything else (besides the ndk-build script) in order to build the tess-two project and import it into eclipse?

  2. What are the exact steps?

I also read something about Cygwin.. Do I need it?

any help would be appreciated!

Ofek Agmon
  • 5,040
  • 14
  • 57
  • 101

1 Answers1

1

To compile the tess-two library, you'll need the following:

  1. Android NDK tools(https://dl.google.com/android/repository/android-ndk-r14-windows-x86_64.zip)
  2. A build of Android build tools with android.bat working(preferably this one: https://dl.google.com/android/repository/tools_r25.2.3-windows.zip)
  3. Apache Ant(http://mirror.fibergrid.in/apache//ant/binaries/apache-ant-1.10.1-bin.zip)
  4. The tess-two files i.e. the zip file that you downloaded.

You'll need to do the following to build the tess-two library:

  1. Extract all the downloaded packages into folders(try to extract them to a path that doesn't have any spaces in the path, this is because Android NDK goes haywire when that happens.)
  2. Open up the Advanced System Settings option in the window that appears when you right click the My Computer (or This PC) icon and select properties.
  3. Select Environment variables at the bottom right corner of the window that appears.
  4. Add entries to Apache Ant plugin (the bin folder inside the folder), Android NDK and the build tools under the PATH variable inside the system variables.
  5. Restart your system if necessary.
  6. Unzip the tess-two zip files into a folder and open the folder in Windows Explorer
  7. While holding down the Shift button, right click anywhere on the blank space inside the window. This should give you an extra option of opening a command prompt window inside the said folder. Choose this option to bring up the command prompt window.
  8. Enter the following commands:

    android update project --path tess-two
    copy tess-two/local.properties .
    gradlew assemble
    
  9. You're all set!