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

Scanning documents with NFC

Overview

MobbScan allows you to get all the information contained on a Passport or Spanish ID card v3 by scanning an NFC chip in case of being available on the device. NFC a 100% reliable data source and only a few configuration steps are required to get it done.

Configuration

Before starting the development you will need to follow these steps:

  1. Add MobbScan NFC extension dependency to your build.gradle configuration file (dependencies section).

    Note: Please remember to change the versions for the ones available in the distribution file.

    dependencies {
        ...
        implementation(name: 'mobbscan-nfc-extension-android', version: 'X.Y.Z', ext: 'aar')
        implementation ('org.jmrtd:jmrtd:0.7.18')
        implementation ('net.sf.scuba:scuba-sc-android:0.0.20')
        ...
    }
    
  2. Add NFC permission and feature in the AndroidManifest.xml on your project:

    <!-- Required to access the NFC chip -->
    <uses-permission android:name="android.permission.NFC" />
    <uses-feature android:name="android.hardware.nfc" android:required="true" />
    

NFC scanning process

Note: To start the nfc scanning process you should have done the startScan method to get the scan id previously. If you don't know how to to this, please visit the getting started guide.

Kotlin
Java
// Set this value to true if you want to get the face of the document.
val getImageFace = true
NfcDocumentReader.getInstance().configureService(activity, getImageFace, object : OnNfcDocumentReaderFinish {
override fun onScanSuccess(scanResultData: MobbScanScanResultData) {
// Your scan success code here
}
override fun onScanFailed(error: NfcError) {
// Your scan failed code here
}
}) { nfcEvent, progress ->
// Your onEvent code here
}
// Set this value to true if you want to get the face of the document.
boolean getImageFace = true;
NfcDocumentReader.getInstance().configureService(activity, getImageFace, new OnNfcDocumentReaderFinish() {
@Override
public void onScanSuccess(final MobbScanScanResultData scanResultData) {
// Your scan success code here
}
@Override
public void onScanFailed(final NfcError error) {
// Your scan failed code here
}
}, new OnNfcEvent() {
@Override
public void onEvent(NFCEvent nfcEvent, int progress) {
// Your onEvent code here
}
});

This method receives four parameters, the activity, a flag that indicates if you want to get the image face of the document and two listeners. These listeners are used to update the interface and notify to the user at what point the process is. To know more about these listeners you can take a look to this section.

After calling the configureService(...) method, you have to indicate to the reader to start the process. To do this, you have to call the method readDocumentNFC. This method has two implementations:

  1. Receives only one parameter, the NFC CAN number. This method starts the NFC reader to read ONLY the Spanish ID card V3.

    NfcDocumentReader.getInstance().readDocumentNFC(canNumber);
    
  2. Receives three parameters, the document number, the date of birth and the date of expiry. This method starts the NFC reader to read both documents, the Spanish ID card V3 and the Passport.

    NfcDocumentReader.getInstance().readDocumentNFC(documentNumber, dateOfBirth, dateOfExpiry);
    

    Tip: You can use a default scan to obtain all this data instead of asking for it to the user.

Listeners

Due to the scanning process being long and confusing for the final user, MobbScan provides the OnNfcEvent listener in order to give the developers the option of updating the interface during the NFC scan process with information about the state of the scan.

The listener receives two parameters, the event and the progress.

Kotlin
Java
private fun getOnNfcEvent(): OnNfcEvent? {
return OnNfcEvent { nfcEvent, progress ->
when (nfcEvent) {
NFCEvent.CONFIGURING_SERVICE -> { // Update UI}
NFCEvent.AUTHENTICATING -> { // Update UI }
NFCEvent.READING_DATA -> { // Update UI }
NFCEvent.READING_IMAGE -> { // Update UI }
}
}
}
private OnNfcEvent getOnNfcEvent() {
return new OnNfcEvent() {
@Override
public void onEvent(NFCEvent nfcEvent, int progress) {
switch (nfcEvent) {
case CONFIGURING_SERVICE:
// Update UI
break;
case AUTHENTICATING:
// Update UI
break;
case READING_DATA:
// Update UI
break;
case READING_IMAGE:
// Update UI
break;
}
}
};
}

Once we have finished the NFC events, we can manage the process with OnNfcDocumentReaderFinish method (both for success and failure resuts):

Kotlin
Java
private fun getOnNfcDocumentReaderFinish(): OnNfcDocumentReaderFinish? {
return object : OnNfcDocumentReaderFinish {
override fun onScanSuccess(scanResultData: MobbScanScanResultData) {
// Your scan success code here
}
override fun onScanFailed(error: NfcError) {
// Your scan failed code here
}
}
}
private OnNfcDocumentReaderFinish getOnNfcDocumentReaderFinish() {
return new OnNfcDocumentReaderFinish() {
@Override
public void onScanSuccess(MobbScanScanResultData scanResultData) {
// Your scan success code here
}

@Override
public void onScanFailed(NfcError error) {
// Your scan error code here
}
};
}

Tip: You can see an example of the NFC scan on the sample app provided with the SDK.

← Detect and scan a PDF417Error Handling →
  • Overview
  • Configuration
  • NFC scanning process
  • Listeners
Mobbeel for developers
Product Documentation
MobbIDMobbScanMobbSign
Connect
LinkedInFacebookX
More
FAQContact Us
Mobbeel Solutions SL
Copyright © 2025 Mobbeel Solutions SL