Android
This guide provides step-by-step instructions on installing the IDV SDK into an Android application.
Prerequisites
Before integrating the SDK, ensure the following:
- Android Target SDK 36 or higher recommended
- Camera permission enabled
- NFC permission enabled
- Internet permission enabled
The Regula IDV SDK dependency should be added to build.gradle.kts.
The SDK includes multiple modules (Document Reader SDK, Face SDK). Include only the modules required for your workflow and follow their specific setup instructions.
Add Regula SDK to Gradle
1. Add Regula's Maven repository URL to your build.gradle.kts file:
maven {
url = uri("https://maven.regulaforensics.com/RegulaDocumentReader")
}
// only for Beta versions
maven {
url = uri("https://maven.regulaforensics.com/RegulaDocumentReader/Beta")
}
2. Copy the regula.license and db.dat files to the app/src/main/assets/Regula folder.
3. Enable view and data binding features in your app-level build.gradle.kts by adding them to the android section:
buildFeatures {
viewBinding=true
dataBinding=true
}
and add the kotlin-kapt plugin:
plugins {
id("kotlin-kapt")
}
4. In your app-level build.gradle.kts, add the following dependencies:
// Required only if you're going to use the Document Reader SDK in your workflows
implementation("com.regula.documentreader.core:fullrfid:9.9+@aar") {}
implementation("com.regula.idv:docreader:3.10.+@aar") {
isTransitive = true
}
// Required only if you're going to use the Face SDK in your workflows
implementation("com.regula.face.core:basic:8.4+@aar") {}
implementation("com.regula.idv:face:3.10.+@aar") {
isTransitive = true
}
// Main dependency
implementation("com.regula.idv:api:3.10.+@aar") {
isTransitive = true
}
Sync Gradle after adding the dependencies.
5. By default, the Document Reader API SDK and Face API SDK are included in the docreader and face IDV modules, respectively.
To use different versions of these SDKs, add the corresponding dependencies to your app-level build.gradle.kts:
// Document Reader API SDK
implementation("com.regula.documentreader:api:9.9.+@aar") {
isTransitive = true
}
// Face API SDK
implementation("com.regula.face:api:8.4.+@aar") {
isTransitive = true
}
6. If your workflow requires reading mobile driver's licenses (mDLs), add the BT Device library to your app-level build.gradle.kts:
implementation("com.regula.btdevice:api:9.9.+@aar")
Update AndroidManifest.xml
Ensure the required permissions and features are included:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<uses-feature android:name="android.hardware.camera"
android:required="true" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- Required only if you're going to scan documents using a camera -->
<uses-permission android:name="android.permission.CAMERA"/>
<!-- Required only if you're going to read an RFID chip -->
<uses-permission android:name="android.permission.NFC" />
<!-- Required only if you're going to request the user's location in a workflow or read an mDL -->
<uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION"
tools:remove="android:maxSdkVersion" />
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION"
tools:remove="android:maxSdkVersion" />
</manifest>