Configure MobbScan Android SDK
The present document is a guide to integrate the MobbScan SDK into your Android application.
MobbScan is a solution that allows you to scan a document, extract and validate all the information in it.
Requirements
- Device running Android 4.3 (API level 18) or later
- Camera with autofocus capability
Configuration
In order to be able to use MobbScan Android SDK, you have to follow the next steps.
Configure the SDK
To use the MobbScan Android SDK in your native Android application please follow these steps:
Include the sdk libraries by copying it to your application's libs folder and add this line to your
build.gradle
file (dependencies section).NOTE: Please remember to change the versions for the ones available in the distribution file.
dependencies { ... implementation(name: 'mobb-commons-android', version: 'X.Y.Z', ext: 'aar') implementation(name: 'mobbscan-sdk-android', version: 'X.Y.Z', ext: 'aar') implementation(name: 'cameraviewplus', version: 'X.Y.Z', ext:'aar') implementation(name: 'mobbscan-detector', version: 'X.Y.Z', ext:'aar') ... }
Add a flatDir repository to your
build.gradle
file so that gradle can find the.aar
files in yourlibs
folder:repositories { ... flatDir { dirs 'libs' } ... }
Add the required third party dependencies and package exclusions to your
build.gradle
file:dependencies { ... // MobbCommons third-party dependencies implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.20' // MobbScan third-party libraries (always needed) implementation 'org.greenrobot:eventbus:3.3.1' implementation 'com.rmtheis:tess-two:9.1.0' implementation 'com.madgag.spongycastle:prov:1.54.0.0' implementation 'com.madgag.spongycastle:pkix:1.54.0.0' implementation 'com.google.code.gson:gson:2.8.5' implementation(name: 'opencv-android-3.4.6', ext: 'aar') ... }
Add required permissions in the
AndroidManifest.xml
of your project:<!-- Required to check licenses --> <uses-permission android:name="android.permission.INTERNET" /> <!-- Required to capture the images to scan and extract information --> <uses-permission android:name="android.permission.CAMERA" /> <!-- Required to store temporary files during the scanning process --> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />