Installation
The MobbScan Android SDK is distributed through Mobbeel's private Maven repository. Gradle resolves every transitive dependency for you.
Latest version: 2.37.3. Use this version in the Maven dependency declarations below.
Requirements
- Android
- 5.0 or laterAPI 21
- Compile SDK
- 35 or laterMinimum for the integrating app; SDK artifacts are built with API 34 and target Java 8 bytecode
- Camera
- Rear, with autofocusFront camera for face capture
- Architectures
arm64-v8aarmeabi-v7a- Credentials
- Maven access and license keyThe license is bound to your application ID. Both are provided by Mobbeel.
1. Add the Maven repository
The SDK is hosted on Mobbeel's private Maven repository. Keep the credentials provided by Mobbeel out of source control: add them to your user-level ~/.gradle/gradle.properties (or to a project gradle.properties excluded from version control) and inject them from your CI secret store in automated builds.
mobbeelRepoUser=YOUR_CLIENT_ID
mobbeelRepoPassword=YOUR_CLIENT_PASSWORD
Then declare the repository in settings.gradle (recommended for Gradle 7+):
- Kotlin DSL
- Groovy DSL
val mobbeelUser = providers.gradleProperty("mobbeelRepoUser").get()
val mobbeelPass = providers.gradleProperty("mobbeelRepoPassword").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").get()
def mobbeelPass = providers.gradleProperty("mobbeelRepoPassword").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
}
}
}
}
On older projects that declare repositories in the root build.gradle, add the same maven { … } block inside allprojects { repositories { … } } and read the credentials with project.findProperty("mobbeelRepoUser").
Never commit a file that contains the repository credentials.
2. Add the dependencies
Add the core SDK and only the optional modules you need:
dependencies {
// Core SDK: document scan, face matching and liveness
implementation("com.mobbeel:mobbscan-sdk-android:2.37.3")
// Optional: unattended video recording
implementation("com.mobbeel:mobbscan-video-android:2.37.3")
}
| Module | Needed for |
|---|---|
mobbscan-sdk-android | Every integration |
mobbscan-video-android | Video recording |
Gradle resolves every third-party library the modules need (ZXing for PDF417, Twilio Video for the video module…): do not add them yourself.
3. Declare permissions
<!-- Always required -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<!-- Video recording only -->
<uses-permission android:name="android.permission.RECORD_AUDIO" />
Request the camera (and microphone) runtime permissions before launching a capture. If they are missing, the SDK returns PERMISSION_ERROR.
4. Prepare release builds
16 KB memory page size
Google Play requires apps targeting Android 15+ to support 16 KB memory pages. Since 2.37.0, the native libraries for the supported Android ABIs (arm64-v8a and armeabi-v7a) are built with NDK r29 and aligned to 16 KB. The Twilio Video 7.10.0 library used by the video module is aligned as well. Update to 2.37.0 or later; no other change is needed.
To check an APK or AAB, list the load segments of its native libraries: every LOAD segment must have an alignment of 0x4000 (16384) or more.
readelf -lW lib/arm64-v8a/*.so | grep LOAD
Restrict ABIs (optional)
If your app targets phones only, you can ship the ARM libraries alone to reduce the download size:
android {
defaultConfig {
ndk {
abiFilters += listOf("arm64-v8a", "armeabi-v7a")
}
}
}
ProGuard / R8
If you minify your release build, add these rules to proguard-rules.pro, plus the ones for each optional module you use. Keep the rules your app already has for other dependencies, and remove a rule only after verifying a minified release build.
- Core SDK
- Video module
-keepattributes *Annotation*, Exceptions, Deprecated, Signature, MethodParameters, InnerClasses
-keepparameternames
## EventBus
-keepclassmembers class * {
@org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
# Only required if you use AsyncExecutor
-keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
<init>(java.lang.Throwable);
}
## Tesseract
-keep class com.googlecode.tesseract.android.TessBaseAPI {
protected void onProgressValues(int, int, int, int, int, int, int, int, int);
}
## MobbScan
-dontwarn com.mobbeel.**
-dontwarn okio.mobbeel.**
-dontwarn org.opencv.**
-dontnote org.apache.http.**
-keep class com.mobbeel.** { *; }
## Gson
-dontwarn sun.misc.**
-keep class com.google.gson.stream.** { *; }
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
## MobbCommons
-dontwarn mobbeel.http.**
-dontwarn javax.annotation.**
-dontwarn org.conscrypt.**
-keepnames class mobbeel.http.internal.publicsuffix.PublicSuffixDatabase
## SpongyCastle
-keep class org.spongycastle.crypto.* {*;}
-keep class org.spongycastle.crypto.agreement.** {*;}
-keep class org.spongycastle.crypto.digests.* {*;}
-keep class org.spongycastle.crypto.ec.* {*;}
-keep class org.spongycastle.crypto.encodings.* {*;}
-keep class org.spongycastle.crypto.engines.* {*;}
-keep class org.spongycastle.crypto.macs.* {*;}
-keep class org.spongycastle.crypto.modes.* {*;}
-keep class org.spongycastle.crypto.paddings.* {*;}
-keep class org.spongycastle.crypto.params.* {*;}
-keep class org.spongycastle.crypto.prng.* {*;}
-keep class org.spongycastle.crypto.signers.* {*;}
-keep class org.spongycastle.jcajce.provider.** { *; }
-keep class org.spongycastle.jcajce.spec.* {*;}
-keep class org.spongycastle.jce.** {*;}
## BouncyCastle
-keep class org.bouncycastle.crypto.* {*;}
-keep class org.bouncycastle.crypto.agreement.** {*;}
-keep class org.bouncycastle.crypto.digests.* {*;}
-keep class org.bouncycastle.crypto.ec.* {*;}
-keep class org.bouncycastle.crypto.encodings.* {*;}
-keep class org.bouncycastle.crypto.engines.* {*;}
-keep class org.bouncycastle.crypto.macs.* {*;}
-keep class org.bouncycastle.crypto.modes.* {*;}
-keep class org.bouncycastle.crypto.paddings.* {*;}
-keep class org.bouncycastle.crypto.params.* {*;}
-keep class org.bouncycastle.crypto.prng.* {*;}
-keep class org.bouncycastle.crypto.signers.* {*;}
-keep class org.bouncycastle.jcajce.provider.** { *; }
-keep class org.bouncycastle.jcajce.spec.* {*;}
-keep class org.bouncycastle.jce.** {*;}
-dontwarn javax.naming.**
-keep class net.sf.scuba.smartcards.** { public *; }
# Twilio Video
-keep class tvi.webrtc.** { *; }
-keep class org.webrtc.** { *; }
-keep class com.twilio.video.** { *; }
-keepattributes InnerClasses
Troubleshooting
Gradle sync fails with
401 UnauthorizedCheck the Maven credentials ingradle.properties. Contact Mobbeel if they have expired.UnsatisfiedLinkErrorat runtimeCheck that the device ABI is supported and included in your app filters:arm64-v8aorarmeabi-v7a.Classes missing in release builds
Add the ProGuard rules above, including those of each optional module.Upgrading from
.aarfilesFollow Migration.
Next step
Initialise the SDK and run your first verification in the Quick start.