Mobbeel for developers

Mobbeel for developers

  • MobbScan
  • MobbID
  • MobbSign
  • Clients
  • FAQ

›Getting Started

MobbScan Android SDK

  • Configure MobbScan Android SDK

Getting Started

  • Getting started with MobbScan
  • Detect and scan a document in two different calls
  • Detect and scan MRZ
  • Detect and scan a PDF417
  • Scanning documents with NFC
  • Error Handling

Additional configuration

  • Configure the detection process
  • Perform face matching with MobbScan
  • Select images returned by a scan
  • Fix scan orientation
  • Record a video while user performs a scan
  • Adding a video step
  • Configure Play Store distribution

MobbScan UI customization

  • Customize MobbScan Default Interfaces
  • Customize MobbScan document scan UI
  • Customize MobbScan MRZ scan UI
  • Customize Unattended Process UI
  • Customize feedback messages

MobbScan-Agent configurations

  • Getting the verification result

Migration Guides

  • Migration 2.25.x to 2.26.x
  • Migration 2.24.x to 2.25.x
  • Migration to 2.24.x
  • Migration to 2.22.x
  • Migration 2.19.x to 2.21.x
  • Migration 2.18.x to 2.19.x
  • Migration 2.13.x to 2.14.x

Information

  • Changelog
  • API Reference

Getting started with MobbScan

SDK Example

Two example application are included in the SDK (One implemented with Java another one with Kotlin). You can find them under at the root folder of the SDK, under the names of sample and sample-kotlin.

The example app simply scans a spanish idendity document and then shows all results on screen.

To use it you just have to import it on your Android Studio as a Gradle project using the default gradle wrapper. Once the import has finished you should be able to build and run the sample in your own device.

Perform document scan

License key

To start using the SDK you need to obtain a license key that is bound to your application.

The license key is generated for your specific application package (specified on your AndroidManifest.xml) and it should be used to initialize the SDK.

Initialization

First step is always initializing the API. You need to do this before any other action or the SDK will not work. You need your license key to complete this step.

Kotlin
Java
MobbScanAPI.getInstance().initAPI("YOUR_LICENSE_HERE", this, { licenseResult, validTo -> 
// Your code for the listener here...
}
MobbScanAPI.getInstance().initAPI("YOUR_LICENSE_HERE", this, new LicenseStatusListener() {
@Override
public void onLicenseStatusChecked(MobbScanLicenseResult licenseResult, Date validTo) {
// Your code for the listener here...
}
});

Note: Please, review your context, as it could be different from this.

Setting up the SDK parameters

Now you can set up the SDK based on your specific needs.

For now we will only see the minimum parameters to get MobbScan working.

Kotlin / Java
MobbScanAPI.getInstance().setBaseUrl("YOUR_SERVER_URL_HERE");

Start process

Once the API is initialized and the SDK is configured as you need it, you have to start a new scan process.

Kotlin
Java
var docType = MobbScanDocumentType.ESP
var opMode = MobbScanOperationMode.SCAN_BOTH_SIDES
MobbScanAPI.getInstance().startScan(docType, opMode) { result, scanId, error ->
// Your code for the listener here...
}
MobbScanDocumentType docType = MobbScanDocumentType.ESP;
MobbScanOperationMode opMode = MobbScanOperationMode.SCAN_BOTH_SIDES;
MobbScanAPI.getInstance().startScan(docType, opMode, new ScanStartListener() {
@Override
public void onScanStarted(MobbScanStartScanResult result, String scanId, MobbScanAPIError error) {
// Your code for the listener here...
}
});

The parameters needed on startScan(...) method are these:

  • The first parameter is the document type to be scanned.

  • The second parameter is the operation mode to be performed. This can have the next values:

    valuedescription
    SCAN_BOTH_SIDESThe scan operation will include both sides of the document
    SCAN_ONLY_BACKThe scan operation will include only the back side of the document
    SCAN_ONLY_FRONTThe scan operation will include only the front side of the document

    Warning: When you are going to scan a document with just one side (such as Passport_TD3), you must use the scan operation SCAN_ONLY_BACK.

  • The third parameter is the ScanStartListener called when the operation is completed. This listener implements a method that returns 3 values:

    valuedescription
    MobbScanStartScanResult resultreturns if the operation was OK or some ERROR occured
    String scanIdreturns the scanId associated with the operation we are going to perform
    MobbScanAPIError errorreturns the error code with some extra information

    Tip: Be sure of saving the scanId string, as you will need it for next API calls and for retrieving evidences after the scan process.

    Note: This scanId is unique for every scan operation (both sides scans are considered as one scan operation), if you want to perform a scan followed by another scan, you must call the scanStart(...) method before each scan or the newer scans will override past ones.

Scan a document side

Each side of the document have to be scanned separately, specifying which side is scanned in each step.

Before seeing the actual code we have to understand the two operations that MobbScan performs:

  • Detection: this is the part where the camera opens and looks for a document. Once a document it's detected, it will be returned.
  • Scan: in this part we take the previously detected document and extract the information from it.

With that knowledge we can call the scanDocument(...) method passing two listeners, one for each operation that will be performed.

Kotlin
Java
var docSide = MobbScanDocumentSide.FRONT
MobbScanAPI.getInstance().scanDocument(docSide, "YOUR_SCAN_ID_HERE", { result, resultData, error ->
// Your code for the detection listener here...
}, { result, resultData, error ->
// Your code for the scan listener here...
})
MobbScanDocumentSide docSide = MobbScanDocumentSide.FRONT;
MobbScanAPI.getInstance().scanDocument(docSide, "YOUR_SCAN_ID_HERE", new IDDocumentDetectionListener() {
@Override
public void onIDDocumentDetected(MobbScanDetectionResult result, MobbScanDetectionResultData resultData, MobbScanAPIError error) {
// Your code for the listener here...
}
}, new IDDocumentScanListener() {
@Override
public void onIDDocumentScanned(MobbScanScanResult result, MobbScanScanResultData resultData, MobbScanAPIError error) {
// Your code for the listener here...
}
});

Each listener returns different informations:

IDDocumentDetectionListener

  • MobbScanDetectionResult: represents the possible results for the detect operation:

    valuedescription
    OKOperation finished sucessfully
    ERRORSomething happened during the detection process
  • MobbScanDetectionResultData: object containing the bitmap of the document detected and the side of the document detected.

  • MobbScanAPIError: object that specifies the error ocurred during the process. Contains the error code and extra information about the error.

IDDocumentScanListener

  • MobbScanScanResult: represents the possible results for the scan operation:

    valuedescription
    COMPLETEDThe scan of this side of the document succeed, and the scan of the document has been completed
    PENDING_OTHER_SIDEThe scan of this side of the document succeed, but there is still another side to be scanned before having the result
    ERRORSomething happened during the detection process
  • MobbScanScanResultData: object containing the IDDocument object with all the extracted information and the side of the document scanned.

  • MobbScanAPIError: object that specifies the error ocurred during the process. Contains the error code and extra information about the error.

When the scanDocument(...) method is called, a new activity will be created and showed, closing itself when the detection process is finished.

← Configure MobbScan Android SDKDetect and scan a document in two different calls →
  • SDK Example
  • Perform document scan
    • License key
    • Initialization
    • Setting up the SDK parameters
    • Start process
    • Scan a document side
Mobbeel for developers
Product Documentation
MobbIDMobbScanMobbSign
Connect
LinkedInFacebookX
More
FAQContact Us
Mobbeel Solutions SL
Copyright © 2025 Mobbeel Solutions SL