Configure a New Project (Android)

Android  Minimum Requirements

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

1. Include AAR

Include AAR as a new module
  1. After creating a new project, go to New > New Module.
  2. Select Import .JAR/.AAR Package.
    Screen_Shot_2022-01-27_at_20.13.49.png
  3. Click Next.
  4. Select the AAR file (Binah's SDK) - (bnhhrlib.aar).
  5. Click Finish. The Subproject bnhhrlib is added to your project.
    Screen_Shot_2020-04-23_at_21.04.55.png
    Screen_Shot_2020-04-23_at_21.05.36.png

2. Create Dependencies

Create dependencies
  1. Open the build.gradle of your application.
  2. Under dependencies, add implementation project(':bnhhrlib').
    Screen_Shot_2020-04-23_at_21.26.19.png
  3. Under dependencies, add the following:
    implementation 'com.babylon.certificatetransparency:certificatetransparency-android:0.2.0'
  4. Open settings.gradle, and make sure the include ':bnhhrlib' is there. If it is not there, simply add it to the file.
    Screen_Shot_2020-04-23_at_21.07.56.png

The SDK is ready for implementations.

3. Configure C++ and NDK

Configure C++ and NDK

To enable your Android to work with our C++ native libraries, install an NDK that supports C++ 17.

  • Install NDK version 20 and higher (Recommend: 20.1.5948944)
  1. Open Android Studio.
  2. Go to Tools > SDK Manager.
    Screen_Shot_2020-05-05_at_12.05.21.png
  3. In the Preferences for New Projects window, do the following:
    • Select SDK Tools.
    • Select the Show Package Details option.
      Screen_Shot_2020-05-05_at_12.16.35.png
  4. Scroll to NDK (Side by side), and select the correct NDK version (20.1.5948944)
    Screen_Shot_2020-05-05_at_12.18.01.png
  5. Click OK to begin the installation.
  6. When asked, click OK to confirm the changes.
    Screen_Shot_2020-05-05_at_12.18.43.png
    The NDK installation begins.
    Tip: Click Background to move this window to the background.
    Screen_Shot_2020-05-05_at_12.19.26.png


4. Start Implementation

Start implementation
  1. Open the MainActivity Java file and add import ai.binah.hrv.*;.
  2. When you start typing, an auto completion box opens, indicating the SDK was added.
    Screen_Shot_2020-04-23_at_21.09.09.png

5. Add Unique IDs

Add unique IDs for license management
    1. Create a Java file in the same location where the mainActivity is located, and name it LicenseDetails.java.
    2. Include one string for the license key as follows:
      public static final String LICENSE_KEY = "XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX";

6. Configure Build/Deployment Configurations

Configure build/deployment configurations

Configure build/deployment configurations (default APK or APK from app bundle)

  1. Add the following line of code to the gradle.properties file
    android.bundle.enableUncompressedNativeLibs=false
  2. Save the changes made to the file.
  3. Go to Run/Debug Configurations.BUILD1.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 the configuration.

Note

  • Run the application on a real device to test (it does not work on an emulator)
  • Google prefers publishing with the Android App Bundle on Google Play. To learn more, see about About Android App Bundles.
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.