For the complete documentation index, see llms.txt. This page is also available as Markdown.

Android

Faceplugin ID Document Recognition Android SDK. On-premise OCR, MRZ, barcode, and authenticity. documentreadersdk.aar in libdocsdk, not libfacesdk.

Fully on-premise ID Document Recognition SDK for Android. Reads passports, national IDs, and driver licenses. Place documentreadersdk.aar in libdocsdk/, not libfacesdk/.

Public class: com.faceplugin.documentreadersdk.DocumentReaderSDK. Demo id: com.faceplugin.documentreader.

Code

Setup

  1. Copy the SDK (libdocsdk folder) to the root folder in your project. Place documentreadersdk.aar from Google Drive inside libdocsdk/.

  2. Add SDK to the project in settings.gradle

  1. Add dependency to your build.gradle

  1. minSdk 24, JDK 17. Call setActivation → init off the UI thread.

Status codes: 0 Success, 1 Invalid license, 2 Expired, 3 Not activated, 4 Init failed.

APIs

setActivation: This API is used to activate the SDK

init: This API is used to initialize the SDK

getMachineCode: This API is used to retrieve the machine code

getLicenseStatus: This API is used to read recognition and authenticity flags

locateDocument: This API is used to find document corners on a preview frame

Input

Preview bitmap.

Return value

JSON: corners + score. No OCR. Use for the overlay only.

Also: locateVideoFrame(byte[] nv21, int width, int height, int rotation) for camera NV21 frames.

recognize: This API is used to run FullProcess (OCR / MRZ / barcode / authenticity)

Input

One image, or front + optional back. Authenticity "normal" / "none" or boolean.

Return value

JSON: OCR / MRZ / barcode, verification, image quality, crops, security (if licensed).

Verification: 0 Pass, 1 Fail, 2 Not checked.

documentRecognition: This API is used to run OCR / MRZ / barcode / image quality only

Authenticity is always off.

documentLiveness: This API is used to run authenticity / security only

OCR / MRZ / barcode / image quality are always off.

startNewSession: This API is used to open a FullProcess session before recognize

deinit: This API is used to unload the engine

deinit() returns a String (not int).

Run the demo

  1. Place documentreadersdk.aar in libdocsdk/ (not libfacesdk).

  2. Keep the demo package name com.faceplugin.documentreader.

  3. Run on a physical phone.

  4. Home: Camera, Gallery, About. Result tabs: OCR / MRZ / barcode, Liveness (security), Images, Raw JSON.

Screenshots

Home
Camera
Gallery

Faceplugin Document Reader Android home

Faceplugin Document Reader camera overlay

Faceplugin Document Reader gallery

Result
Security
Images

Faceplugin Document Reader result

Faceplugin Document Reader security

Faceplugin Document Reader crops

License

Licenses are offline. Request a new license key for your own app. Parse the JSON with Document result JSON.

Try it (after the demo compiles)

Request a License & Support · Contact us

FAQ

Passport OCR on Android? Yes. DocumentReaderSDK.recognize / documentProcess return OCR, MRZ, barcode, and crops. See Document result JSON.

Offline? Yes after setActivation / init with a license key for the demo app id (or yours).

Last updated