Android - How to configure a new project

Configuring a new project.

Android minimum requirements:

  • Support with Arm64-v8a CPU instruction set.
  • Support with API level 27 and above.

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.

Configuring c++ and NDK:

In order to allow your Android to work with our C++ native libraries, you have to install NDK that supports with C++ 17.

We have to install NDK version 20 and above (Recommend: 20.1.5948944)

to install:

  1. Open Android Studio
  2. Go to Tools->SDK Manager

    Screen_Shot_2020-05-05_at_12.05.21.png

  3. On the following screen under "Android SDK" section
  4. Choose "SDK Tools" and check the "Show Package Details" check-box

    Screen_Shot_2020-05-05_at_12.16.35.png

  5. Scroll down to "NDK (Side by side)" section and choose the right NDK version (20.1.5948944)

    Screen_Shot_2020-05-05_at_12.18.01.png

  6. Click on "OK" to start installing.
  7. And accept the following screen:

    Screen_Shot_2020-05-05_at_12.18.43.png

  8. NDK installation begins.
  9. You can move this window to the Background by clicking on "Background"

    Screen_Shot_2020-05-05_at_12.19.26.png

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";

Configuring build/deployment configurations (Default APK or APK from app bundle):

  1. Add the following line of code on the gradle.properties file: 
    android.bundle.enableUncompressedNativeLibs=false
  2. Save the changes that you made on the file
  3. Go to Run/Debug ConfigurationsBUILD1.png
  4. Select app
  5. Change Installation Options-> Deploy from “Default APK” to “APK from app bundle”build2.png
  6. Click OK
  7. Run the Project on a real device to test if the configuration works

 

Note:

  • Run the application on a real device to test as it will not work on an emulator
  • Google prefers publishing with the Android App Bundle on Google Play. To know more about Android App Bundles, please refer to this link.
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.