Getting Started with LEADTOOLS for Android

How to set up the LEADTOOLS Demos Android Development Environment

Before working with the LEADTOOLS Android demo projects, take the following steps to set up the Android development environment.

  1. Download and install the Android Studio IDE:

  2. Extract the LEADTOOLS Android ZIP file.

How to Import and set up the Demos into Android Studio:

  1. Run the Android Studio IDE.

  2. In Android Studio, Select "Open an existing Android Studio project":

  3. Select the path for any of the demos to load. For instance, try <LEADTOOLS>/Examples/Android/ViewerDemo. Note: When the demo is opened the first time, Android Studio will ask for the Gradle settings:

    Gradle Sync

    Click OK to use the Gradle Wrapper, or Cancel to set the path to a local Gradle distribution.

  4. Set the LEADTOOLS license:

    • Add the license file (i.e. LEADTOOLS.lic) to <INSTALLDIR>/Examples/Android/ViewerDemo/viewerDemo/src/main/res/raw/leadtools.lic

      Note: Raw files must contain only [a-z0-9_.]

    • Update the license info as follows:

      int licenseResourceId = R.raw.leadtools; 
      // "dev_key" is the LEADTOOLS license developer key (The content of LEADTOOLS.lic.key)  
      Support.setLicense(this, licenseResourceId, "dev_key"); 

  5. Choose to use LEADTOOLS libraries from you local installation, or opt to use remote Maven artifacts. In the root build.gradle file for each LEADTOOLS demo, a project-wide variable is defined:

    project.ext.useMaven = false

    By default, this value is false. To use LEADTOOLS libraries from Maven artifacts, set this value to true, clean your project, and rebuild. Always clean the project (gradlew clean) after changing this value.

  6. Click the Run button

    Android Studio Run

  7. The "Select Deployment Target" dialog will appear. Select the target device to install the demo APK.

See Also

Setting a Runtime License

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

LEADTOOLS Imaging, Medical, and Document