Configure MobbScan Android SDK
Migrating from previous versions
If you are upgrading from older versions where MobbScan was distributed via .zip containing .aar files, please follow our Migration Guide. The SDK is now distributed via our secure Maven Nexus repository.
Requirements
- Device running Android 5.0 (API level 21) or later
- Camera with autofocus capability
compileSdk35 or higher- MobbScan SDK artifacts target Java 8 bytecode. Set your app's Java compatibility according to your project and Android Gradle Plugin requirements.
Configure the Maven repository
MobbScan SDK artifacts are hosted on Mobbeel's private Maven Nexus repository. To access the artifacts, you need credentials provided by Mobbeel.
Step 1: Secure your credentials (Recommended)
To keep credentials out of version control, add them to your user-level ~/.gradle/gradle.properties file. You may use a project-level gradle.properties only if it is excluded from version control. For CI builds, inject the values through your CI secret store. Never commit a file containing repository credentials.
mobbeelRepoUser=YOUR_CLIENT_ID
mobbeelRepoPassword=YOUR_CLIENT_PASSWORD
Step 2: Add repository to Gradle
Depending on your project structure and Gradle version, configure the repository in settings.gradle (recommended for Gradle 7+) or in your root build.gradle:
val mobbeelUser: String = providers.gradleProperty("mobbeelRepoUser").orElse("YOUR_CLIENT_ID").get()
val mobbeelPass: String = providers.gradleProperty("mobbeelRepoPassword").orElse("YOUR_CLIENT_PASSWORD").get()
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {
url = uri("https://repository.mobbeel.com/repository/release/")
credentials {
username = mobbeelUser
password = mobbeelPass
}
}
}
}
def mobbeelUser = providers.gradleProperty("mobbeelRepoUser").getOrElse("YOUR_CLIENT_ID")
def mobbeelPass = providers.gradleProperty("mobbeelRepoPassword").getOrElse("YOUR_CLIENT_PASSWORD")
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {
url uri("https://repository.mobbeel.com/repository/release/")
credentials {
username = mobbeelUser
password = mobbeelPass
}
}
}
}
allprojects {
repositories {
google()
mavenCentral()
maven {
url uri("https://repository.mobbeel.com/repository/release/")
credentials {
username = project.findProperty("mobbeelRepoUser") ?: "YOUR_CLIENT_ID"
password = project.findProperty("mobbeelRepoPassword") ?: "YOUR_CLIENT_PASSWORD"
}
}
}
}
Important: Use the credentials provided by Mobbeel and keep them out of version control. Do not commit
gradle.propertiesif it contains credentials.
Add SDK dependencies
Add the MobbScan SDK dependency to your application module's build.gradle (or build.gradle.kts):
dependencies {
// Core MobbScan SDK
implementation 'com.mobbeel:mobbscan-sdk-android:2.37.0'
}
dependencies {
// Core MobbScan SDK
implementation("com.mobbeel:mobbscan-sdk-android:2.37.0")
}
Optional modules
Depending on the features required by your application, you can include the following optional modules:
Video recording (unattended video verification)
If you want to record videos during the verification process, add the video module:
dependencies {
implementation 'com.mobbeel:mobbscan-sdk-android:2.37.0'
implementation 'com.mobbeel:mobbscan-video-android:2.37.0'
}
dependencies {
implementation("com.mobbeel:mobbscan-sdk-android:2.37.0")
implementation("com.mobbeel:mobbscan-video-android:2.37.0")
}
NFC reading (passports and electronic ID cards)
If you want to read NFC chips from electronic passports or Spanish ID cards, add the NFC extension:
dependencies {
implementation 'com.mobbeel:mobbscan-sdk-android:2.37.0'
implementation 'com.mobbeel:mobbscan-nfc-extension-android:2.37.0'
}
dependencies {
implementation("com.mobbeel:mobbscan-sdk-android:2.37.0")
implementation("com.mobbeel:mobbscan-nfc-extension-android:2.37.0")
}
Required permissions
Add the following permissions to your AndroidManifest.xml:
<!-- Required to check licenses and connect to verification services -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Required to capture images for scanning -->
<uses-permission android:name="android.permission.CAMERA" />
For video recording, also add:
<!-- Required to record audio during video verification -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
For NFC reading, also add:
<!-- Required to access NFC chip -->
<uses-permission android:name="android.permission.NFC" />
<uses-feature android:name="android.hardware.nfc" android:required="true" />
ProGuard / R8 configuration
If you enable ProGuard or R8 in your release builds, use the full ProGuard / R8 rules for Play Store distribution, including the sections for each SDK module you use. Do not remove existing dependency rules just because Maven now resolves those dependencies automatically; verify any rule removal with a minified release build first.
Play Store distribution and architectures
MobbScan SDK binaries are aligned with 16 KB page-size requirements across arm64-v8a, armeabi-v7a, x86, and x86_64. Mobbeel-built native libraries use NDK r29.
If you want to optimize your final APK or AAB download size for mobile devices, you can configure ABI filters:
android {
defaultConfig {
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a'
}
}
}
Complete configuration example
Here is a complete example of an app module's build.gradle:
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
namespace 'com.example.mobbscanapp'
compileSdk 35
defaultConfig {
applicationId "com.example.mobbscanapp"
minSdk 21
targetSdk 35
versionCode 1
versionName "1.0.0"
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.mobbeel:mobbscan-sdk-android:2.37.0'
}
Next steps
Once configured, follow the Getting Started guide to initialize the SDK and start scanning documents.
