NEWSMRZ Scanner is now part of barKoder.What it means for you →

DOCUMENTATION

Android

Native mobile

Documentation / Native mobile

On this page

The Android SDK is a library, mrzscanner-ar, with the scanner core for arm64-v8a, armeabi-v7a, x86 and x86_64. It has a ready camera screen with AR mode, photo scanning, and a view for your own layout.

Needs: Android 7.0 (API 24) or later.

Install

The SDK comes as a small Maven repository (under Downloads in the portal). Copy its maven folder into your project, then:

// settings.gradle.kts
dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
        maven { url = uri("mrzscanner/maven") }   // the folder you copied
    }
}

// app/build.gradle.kts
dependencies {
    implementation("com.barkoder.mrzscanner:mrzscanner-ar:2.5.0")
}

Register the key

Once, when the app starts (for example in Application.onCreate):

val result = MrzScan.registerLicense(context, "MRZ2...")   // {"status":0,"reason":null}

Scan with the camera

The camera screen is an activity. Launch it with the activity result contract; settings and results are JSON (see Scan settings and Scan results).

val scan = registerForActivityResult(MrzScan.Contract()) { resultJson ->
    // {"status":"read","reads":[{"text":"P<UTO...","fields":{...},"checkDigitsValid":true}], ...}
}

scan.launch("""{"documentTypes":["passport","id"]}""")   // or null for the defaults

The screen asks for the camera permission itself.

Scan a photo

val readJson = MrzScan.scanImage(context, """{"path":"$photoPath"}""")   // an MrzRead as JSON, or "null"

The image can also be {"base64": "..."} (a JPEG or PNG).

Your own layout

MrzScanView is the camera with the AR overlay as a view, for your own screen instead of the full-screen activity.

Updated Oct 24, 2026 ยท Questions? Ask us