Get Started with Android Demos - Android Java

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

Open the Android Demo Project

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:

  1. Go to the LEADTOOLS SDK Downloads page. You have two options to download:
    1. Use a downloadable application called LEADTOOLS Installer.
    2. Scroll down to the direct link: LEADTOOLS Evaluation - Android Native Binaries and Projects (154 MB).
  2. Download the binaries and projects either from the application or the direct link on the page.

Set the LEADTOOLS License

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.

Screenshot of the license LIC file added to the Raw folder.

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:

Java
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 
Screenshot of where and how to modify and input KEY string.

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.

Run the Demo

To run the Android demo, press Shift + F10 or click Run -> Run <APP_NAME>.

Wrap-up

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.

See Also

Help Version 22.0.2024.3.20
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.