Skip to content

Repository files navigation

FacePlugin

🌐 Company Site - Here

🤗 Hugging Face - Here

🛟 Help Center - Here

🐳 Docker Hub - Here

ID Document Recognition SDK — Android (Fully On-Premise)

Ready in ~10 minutes (after AAR download): Drop documentreadersdk.aar into libdocsdk/ → Run on a phone Jump: Get the AAR · Run the demo · Setup (your own app) · About SDK

Introduction

Explore FacePlugin Document Reader SDK — ID cards, passports, driver licenses with OCR, MRZ and barcode.

This is an on-premise FacePlugin SDK. All processing stays on the device — no biometric data is sent to FacePlugin cloud.

This repository is the Android demo app — a standalone customer repo. Runtime is libdocsdk/documentreadersdk.aar (download from Google Drive). No other FacePlugin repository is required.

◾ Main Functionalities

Feature Supported
ID Card / Passport / Driver License
MRZ / Barcode / QR / OCR
Document detection & classification
Auto-capture & image quality

◾ Product List

Platform Repository
Android ID-Document-Recognition-Android
iOS ID-Document-Recognition-iOS
Windows ID-Document-Recognition-Windows
Linux / Docker ID-Document-Recognition

Before you start

Step What you need
1 Android Studio + a real device (emulator is not recommended)
2 documentreadersdk.aar in ./libdocsdk/ — see Get the AAR
3 Demo license is already in the repo (LICENSE_KEY for com.faceplugin.documentreader, valid until 12 August 2027). Request a new key only if you change applicationId — see SDK License

You can run the sample app as-is. Camera and gallery unlock when the status bar shows Ready.

System requirements

documentreadersdk.aar includes native libs for four ABIs. The sample app may filter to arm64-v8a only to keep the debug APK smaller — that is not an SDK limit.

Item Minimum Recommended
Android API 24 (7.0) API 29 (10) or newer
ABI arm64-v8a, armeabi-v7a, x86_64, x86 arm64-v8a (typical phones)
RAM 4 GB 6 GB or more
CPU 4+ cores Mid-range SoC from ~2019 or newer (e.g. Snapdragon 7-series / Dimensity 700+)
Camera Rear camera 1080p, autofocus
Device Physical device Same; emulator is not for camera

Get the AAR (libdocsdk)

libdocsdk/documentreadersdk.aar is empty on GitHub because the binary is too large.

Where to download

DocumentReader-Android-App runtime (Google Drive)

How to place it

  1. Clone this repo (if you have not already):
git clone https://github.com/Faceplugin-ltd/ID-Document-Recognition-Android.git
cd ID-Document-Recognition-Android
  1. Download documentreadersdk.aar from the Drive folder.
  2. Put it here (not in a nested folder):
ID-Document-Recognition-Android/
└── libdocsdk/
 └── documentreadersdk.aar

Run the demo

  1. Open this folder in Android Studio.
  2. Run on a device. The demo already has a valid LICENSE_KEY for com.faceplugin.documentreader.

The green bar at the bottom of the home screen is the SDK status (Checking license…Loading database…Ready). Camera and Gallery stay disabled until it shows Ready. Home tiles are one row under the title: Camera | Gallery | About. Camera shows the live overlay; tap Capture when the score is ready (≥ 50%).

Screenshots

Home — Camera, Gallery, About   Camera — live document overlay and Capture   Result — extracted OCR / MRZ fields

SDK License

Licenses are offline and bound to your app identifier.

The sample app already includes a valid key for com.faceplugin.documentreader (until 12 August 2027). You only need a new key if you use a different applicationId.

How to get a license

The code below shows how to use the license:

private const val LICENSE_KEY =
"FP1.RlBMMQMAAQBf3SxYY7bhQfhFFCEPAgAA3/iiRUGiXouaIYrntAmVD2wPeZTesqNc17RCMDyrl0QXCrHcGv3VpADVrxXu+HxhfNtTQFc80m7qZPLtkbRsUvzPnwXiga2STv5ECokcY0Mx8R+9NqtKMK8cUITUVts/0hBW9053jyNsMV5n+hxYlwpG97BvdDJpRBjhgWhpuqdGCm2FnxMZgYOOsVQiLUHjxiOlls2af4UUTNXSedPF0+F1pxTfAQqmvGkx1KTSu63tgTNIH6wybdw58pAyWbFX515ZGSjgM41G6FfOSykLNZYvxFeiRw2KIDMZxImqKCGGQ5nv3L3z8p0PRQLKTcMSasOIw5V2PuHwtXNoM8CHOT9Lltyzx6vAaV9eqwEpu2HfPl29jK/uXNMHpTeP1IVHzVIUwfC9htJ53B34HGOTeFEAw9tMQ9XpEvU35hi907KetbMbUGB55uokAZZU3nOWCbfeacsSy66xJ+hAJKFGdcGSuRIcRaEDfwIZJjuOQrtsCk9SDkBVesNygvOeQ1qm0M5EmMRld6A26eTpuD7iAs/dY0ixgcAPHWPpy0q0Sh/Kq1cO1/yOxhNOmRSYPnH2qkboqZdJdjD8lOUGar3IYt493iL633qK50cLvrvWvbPM+CbLnQPM80/eXIG/HGqnxabNBEjm+Fl9O0OEsJ6xSpPDZ7CaT/aLxpFJ8TVPV9/kijz1LdPpPDj3yk+JtbuLADCBiAJCAVszoGvhFpKEgLztY4qAH4uM0hkW3H8vTgJODV64JGzhGz1ynkAhAxBgAVk3QKZMN87lKm5rS0WT7IOVveq3J7MSAkIB45zvNo6tcFnPNbnxudcjBN8jZhj1gd6edmHauatDaJ6Lxx9Ky8ShqwJGq6kPQw1E6WiCY564wEnbYvvNnO3vWYM="
}

val act = DocumentReaderSDK.setActivation(this, LICENSE_KEY)
val init = if (act == DocumentReaderSDK.SDK_SUCCESS) DocumentReaderSDK.init(this) else act

Please contact us to get the license.

Setup (your own app)

You only need libdocsdk/ (the AAR) and com.faceplugin.documentreadersdk.DocumentReaderSDK. You do not need this demo’s MainActivity / CameraActivity.

  1. Copy the libdocsdk folder into your project root.
  2. Put documentreadersdk.aar inside it (from Drive).
  3. Wire Gradle:

settings.gradle:

include ':app'
include ':libdocsdk'

app/build.gradle:

android {
 defaultConfig {
 minSdk 24
 ndk {
 // AAR ships all four. Filter if you need a smaller APK (Play App Bundle splits ABIs anyway).
 abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64', 'x86'
 }
 }
}
dependencies {
 implementation project(':libdocsdk')
}

The license is bound to your applicationId. Request a key for that id, not the demo’s.

Call init and all process methods off the UI thread.

About SDK

import com.faceplugin.documentreadersdk.DocumentReaderSDK

Call init and process methods off the UI thread. 0 = SDK_SUCCESS. Process methods return JSON.

Activate and init

Thread {
    var ret = DocumentReaderSDK.setActivation(context, "FP1.…")
    if (ret == DocumentReaderSDK.SDK_SUCCESS) {
        ret = DocumentReaderSDK.init(context)
    }
}.start()

Gallery — one image

val bitmap = contentResolver.openInputStream(uri).use { BitmapFactory.decodeStream(it) }
val json = DocumentReaderSDK.recognize(bitmap)

Gallery — front and back

val json = DocumentReaderSDK.recognize(frontBitmap, backBitmap) // backBitmap may be null

Camera overlay (no OCR)

val json = DocumentReaderSDK.locateDocument(frameBitmap)
val obj = JSONObject(json)
val score = obj.optDouble("score", 0.0)
val corners = obj.optJSONObject("position")?.optJSONArray("corners")

Camera capture (OCR)

val json = DocumentReaderSDK.recognize(stillBitmap)

Document authenticity (optional)

val json = DocumentReaderSDK.documentAuthenticity(bitmap)

Unload

DocumentReaderSDK.deinit()

Result JSON

{
  "errorCode": 0,
  "documentName": "United States - California Driving License (2017) Real",
  "ocr": { "dateOfBirth": "" },
  "mrz": { },
  "barcode": { },
  "images": [ { "name": "Portrait", "image": "<jpeg-base64>" } ]
}

SDK codes

Code Constant Status
0 SDK_SUCCESS Activate / init OK
1 SDK_LICENSE_INVALID Invalid license
2 SDK_LICENSE_EXPIRED Expired license
3 SDK_NOT_ACTIVATED Not activated
4 SDK_INIT_FAILED Init failed

List of our Products

Contact

faceplugin.comfaceplugin.com

Releases

Packages

Contributors

Languages