This project may be built manually as an alternative to including the pre-built AAR as an external dependency in your app project. To start the build, import the root directory of this project into Android Studio as an existing Android Studio project, or follow the instructions below to build on the command line.
Note: When building from Android Studio, you may need to set the path to your NDK installation in the Project Structure dialog (File->Project Structure).
##Android Studio and Gradle
The Gradle build uses the gradle-stable plugin and the Android NDK to
build the Tesseract and Leptonica native C/C++ code through a call to
ndk-build
in build.gradle
. After building, the AAR file that is generated
may be imported into your app project as a dependency on a local
binary package.
Type the following commands in a terminal window to build the project from the command line:
On Mac/Linux:
export ANDROID_HOME=/path/to/your/android-sdk
export ANDROID_NDK_HOME=/path/to/your/android-ndk
git clone git://github.com/rmtheis/tess-two tess
cd tess
android update project --path tess-two
cp tess-two/local.properties .
./gradlew assemble
On Windows:
set ANDROID_HOME=C:\\path\\to\\your\\android-sdk
set ANDROID_NDK_HOME=C:\\path\\to\\your\\android-ndk
git clone git://github.com/rmtheis/tess-two tess
cd tess
android update project --path tess-two
copy tess-two\local.properties .
gradlew assemble
On Mac/Linux:
./preparetests.sh
./gradlew connectedAndroidTest
On Windows:
preparetests.cmd
gradlew connectedAndroidTest
Note that some tests will fail due to existing issues.