Android - How to configure a new project (Java)

Configuring a new project.

Include AAR as a new module:

  1. After creating a new project
  2. Go to file->New->New Module
  3. Select "Import .JAR/.AAR Package:

    Screen_Shot_2020-04-23_at_21.03.13.png

  4. Click on Next
  5. Choose the AAR file (Binah's SDK) - (bnhhrlib.aar)
  6. leave the Subproject as is (bnhhrlib)
  7. Click on Finish:

    Screen_Shot_2020-04-23_at_21.04.55.png

  8. The Subproject bnhhrlib will be added under your project:

    Screen_Shot_2020-04-23_at_21.05.36.png

Creating dependencies:

    1. Now we can use all its properties and functions.
    2. Open the build.gradle of your application
    3. Add "implementation project(':bnhhrlib')" under dependencies:

      Screen_Shot_2020-04-23_at_21.26.19.png

    4. Open settings.gradle
    5. Verify that "include ':bnhhrlib'" already exists there:

      Screen_Shot_2020-04-23_at_21.07.56.png

    6. If it does not exist just add it to the file.
    7. Our SDK is ready for implementations.

Start implementation:

  1. Open the MainActivity Java file and add import ai.binah.hrv.*;
  2. While start typing you will get an auto completion box (which means that SDK was added):

    Screen_Shot_2020-04-23_at_21.09.09.png

Adding unique Ids for license management:

  1. Create a Java file "LicenseDetails.java" the same location where the mainActivity is.
  2. Include two strings. One for the product ID and one for the License Key as follows:
  3. public static final String LICENSE_KEY = "XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX";
    public static final String PRODUCT_ID = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";

Remember to:

Run on a real device

 

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.