Add the SDK to Your App

View this page for | |

The recommended development environment is:

  • Google Android Studio® (latest available version)
  • The minimum Android SDK API level supported is 21 (Android 5.0)

However, if you want to leverage biometric authentication features, API level 23 (Android 6.0) is required.

The HID Approve SDK is delivered as an AAR file (HID_Approve_SDK.aar). It is available in the Android/Libraries folder of the delivery package.

Use the SDK in your App

  1. Copy the HID Approve SDK library to your app classpath.
  2. Add the SDK dependencies to your app classpath.

The following gradle snippet provides the list of dependencies:

Copy
dependencies {
    configurations.implementation {
        exclude group: 'javax.activation', module: 'activation'
    }
    
    // slfj logging
    implementation 'org.slf4j:slf4j-api:1.7.36'
    implementation 'com.github.tony19:logback-android-classic:1.1.1-6'

    // https://mvnrepository.com/artifact/net.minidev/json-smart
    implementation 'net.minidev:json-smart:2.4.8'

    // https://mvnrepository.com/artifact/net.sourceforge.jregex/jregex
    implementation 'net.sourceforge.jregex:jregex:1.2_01'

    // https://mvnrepository.com/artifact/com.fasterxml.jackson.core
    implementation 'com.fasterxml.jackson.core:jackson-databind:2.12.3'
    implementation 'com.fasterxml.jackson.core:jackson-annotations:2.12.3'
    implementation 'com.fasterxml.jackson.core:jackson-core:2.12.3'
    implementation 'com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.12.3'

    // https://mvnrepository.com/artifact/com.nimbusds
    implementation 'com.nimbusds:oauth2-oidc-sdk:5.63'
    implementation 'com.nimbusds:lang-tag:1.4.3'
    implementation 'com.nimbusds:nimbus-jose-jwt:8.2.1'

    // Google Android Platform    
    implementation 'androidx.biometric:biometric:1.1.0'
    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'androidx.appcompat:appcompat-resources:1.4.1'
    implementation 'com.google.firebase:firebase-messaging:23.0.8'
    
    // HID Approve SDK
    implementation fileTree(include: ['*.aar'], dir: 'libs')
}

Add Functions to your App

Managing Persistent Data

The HID Approve SDK stores it's persistent data in several databases in the Android application sandbox.

This persistent data can be removed by either:

  • Resetting the HID Approve SDK with the dedicated DeviceFactory.reset() method - all the data will be removed (existing containers, keys...)

  • Clear the data from the operating system using Settings > Apps > YourApp > Storage > Clear data

  • Uninstalling the application