This tutorial shows how to set up and run our LEADTOOLs Android Java demos.
Overview | |
---|---|
Summary | This tutorial covers how to properly add your LEADTOOLS license files and run the Android Demos shipped with the LEADTOOLS SDK. |
Completion Time | 15 minutes |
Platform | Android (Java) |
IDE | Android Studio |
Runtime License | Download LEADTOOLS |
Navigate to one of the Android demo projects and open it in Android Studio.
For the purposes of this demo, we will be setting up and running the MICR demo found at the following default installation location: <INSTALL_DIR>\Examples\OCR\Android\MicrDemo
.
If you do not have the Android Native Binaries and Projects ZIP on your machine proceed as follows:
Navigate the project structure to the directory MicrDemo\micrDemo\src\main\res\raw
. If the raw
folder does not exist in this directory, create a subfolder named raw
in the res
folder.
Copy the LEADTOOLS.LIC
license file into this folder. Ensure that the license file that is copied over is using the lower-case naming convention license.lic
instead of its automatic upper-case naming convention.
Next, navigate to the directory MicrDemo\micrDemo\src\main\java\leadtools.micrdemo\MicrDemoActivity
, and open the JAVA file. The following modifications need to be made to these two lines of code:
int licenseResourceId = R.raw.license;
Support.setLicense(this, licenseResourceId, "dev_key"); // Update "dev_key" with the string inside the LEADTOOLS.LIC.key file being used
Note
The
"dev_key"
parameter needs to be replaced with the string contained inside your developer key file in order to set the license correctly.
To run the Android demo, press Shift + F10
or click Run -> Run <APP_NAME>.
In this tutorial, we covered where to locate the LEADTOOLS Android demo projects, add the LEADTOOLS LIC file to the project, and properly set the LEADTOOLS license to run the Android demo projects.