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
Copy the SDK (
libdocsdkfolder) to therootfolder in your project. Placedocumentreadersdk.aarfrom Google Drive insidelibdocsdk/.Add SDK to the project in
settings.gradle
Add dependency to your
build.gradle
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
Place
documentreadersdk.aarinlibdocsdk/(notlibfacesdk).Keep the demo package name
com.faceplugin.documentreader.Run on a physical phone.
Home: Camera, Gallery, About. Result tabs: OCR / MRZ / barcode, Liveness (security), Images, Raw JSON.
Screenshots






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).
Related documentation
Last updated