Skip to main content

Preparation

Amani SDK-UI package is an interface package prepared using Amani-SDK-V2. You can use this package directly by cloning and modifying it, or you can install the AAR package via jitpack with the following implementation without changing the interface.

Required Permissions

This SDK makes use of the devices Camera, Location and NFC permissions. If you don't want to use location service, please provide in init method.

You must have the following keys in your application's manifest file:

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.NFC" />
<uses-feature android:name="android.hardware.nfc" android:required="false"/>
<uses-permission android:name="android.permission.ScanNFC" />

Requirements

The minimum requirements for the SDK are:

  • API Level 23
  • compileSDKVersion 36

Gradle Properties

Disable R8 full mode, use AndroidX and enable Jetifier like below;

 android.enableR8.fullMode=false
android.useAndroidX=true
android.enableJetifier=true

ProGuard Rule Usage

  • If you are using ProGuard in your application, you just need to add this line into your ProGuard Rules!
    -keep class ai.** {*;}
-dontwarn ai.**
-keep class datamanager.** {*;}
-dontwarn datamanager.**
-keep class networkmanager.** {*;}
-dontwarn networkmanager.**
-keep class ai.amani.jniLibrary.CroppedResult.**{*;}

-keep class org.jmrtd.** {*;}
-keep class net.sf.scuba.** {*;}
-keep class org.bouncycastle.** {*;}
-keep class org.spongycastle.** {*;}
-keep class org.ejbca.** {*;}

-dontwarn org.ejbca.**
-dontwarn org.bouncycastle.**
-dontwarn org.spongycastle.**
-dontwarn org.jmrtd.**
-dontwarn net.sf.scuba.**

-keep class org.tensorflow.lite**{ *; }
-dontwarn org.tensorflow.lite.**
-keep class org.tensorflow.lite.support**{ *; }
-dontwarn org.tensorflow.lite.support**

Integration

Latest Release

1. Add the SDK Dependency

Ensure your project is configured to use JitPack as a repository source.

Settings in settings.gradle:

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven {
url = "https://jfrog.amani.ai/artifactory/amani-sdk"
}
maven {
url = "https://jitpack.io"
}
}
}

Dependency in build.gradle:

Replace Tag with the latest appropriate release as Latest Release

implementation 'com.github.AMANI-AI-ORG:Android.SDK.UI:Tag'

2. Configure Gradle

Enable data binding and configure the aaptOptions block in your Android Gradle setup to prevent TensorFlow Lite model files (.tflite) from being compressed during APK packaging. This ensures that the model files remain directly accessible at runtime without decompression overhead. Additionally, exclude redundant or conflicting metadata files (such as META-INF/versions/9/OSGI-INF/MANIFEST.MF) from the final APK to avoid build-time merge issues when using certain libraries.

android {
// Enable data binding
dataBinding {
enabled = true
}

// Configure aaptOptions to prevent compression of .tflite files
aaptOptions {
noCompress "tflite"
}

// Exclude conflicting or unnecessary metadata to avoid build issues
packaging {
resources {
it.excludes += "META-INF/versions/9/OSGI-INF/MANIFEST.MF"
}
}
}

3. (Optional) Speech Verifier

The Speech Verifier is an optional verification step: the user reads a passphrase (and, optionally, answers knowledge-based identity questions) on camera, the reading is verified on-device, and a single continuous video is recorded as evidence.

Inside the UI SDK this module is linked as compileOnly. Be aware of what that means for your app:

  • ✅ Your app compiles and runs without adding anything — the UI SDK does not pull the Speech Verifier module in for you.
  • ⚠️ If you do not add the runtime dependency below, the build still succeeds with no compile error, but the Speech Verifier step will not work at runtime — the feature is effectively absent. Because there is no build-time warning, this is easy to miss.

To make the feature available at runtime, add its dedicated JFrog repository and the runtime implementation dependency:

settings.gradle (dependencyResolutionManagement.repositories):

maven {
url = "https://jfrog.amani.ai/artifactory/amani-speech-verifier"
}

build.gradle (app module):

implementation 'ai.amani.android:amani-speech-verifier:<version>'

Click <version> above (or see the Speech Verifier SDK Release Notes) for the most recent published version.

Replace <version> with a published release. The module brings its own CameraX, OkHttp and Vosk transitively, and its manifest already declares CAMERA, RECORD_AUDIO and INTERNET (merged automatically).

Feature activation is server-side (Amani team)

Adding the dependency is not enough on its own. The Speech Verifier step must also be enabled from the remote configuration by the Amani team for your profile / KYC flow. If it is not activated on the Amani side, the step will not appear in the flow even when the dependency is present. Contact the Amani team to have it enabled for your configuration.