Skip to Content
Android SDKGuidesInstall and configure

Install and configure

1. Add the dependency

// app/build.gradle.kts dependencies { implementation("com.sladeid:biometric-capture:<version>") }

The AAR bundles the vendor reader SDKs and their native libraries (arm64-v8a, armeabi-v7a). minSdk is 24; the library targets JDK 17.

2. Manifest: USB host + attach routing

<uses-feature android:name="android.hardware.usb.host" android:required="true" /> <application ...> <activity android:name=".MainActivity" android:launchMode="singleTop" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter> <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" /> </intent-filter> <meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" android:resource="@xml/device_filter" /> </activity> </application>

launchMode="singleTop" keeps a single activity instance when the reader is attached while the app is foregrounded.

3. device_filter.xml

List the vendor IDs of the readers you support in res/xml/device_filter.xml. This is what triggers the system permission dialog on attach for SecuGen / BioMini. See the device support matrix for vendor IDs.

<resources> <usb-device vendor-id="4450" /> <!-- SecuGen --> <usb-device vendor-id="5841" /> <!-- Suprema BioMini --> <!-- EADAK / Aratek (10477, 13962) are permissioned in-code; no filter entry needed --> </resources>

4. ProGuard / R8

The AAR ships consumer ProGuard rules that keep the public API, JNI native methods, and vendor classes. If you enable R8 in your app, no extra rules are normally needed. If you strip aggressively, keep:

-keep class com.sladeid.biometric.capture.** { *; } -keep class org.opencv.** { *; } # plus the vendor SDK packages bundled in the AAR

5. Initialize the SDK

val sdk = SladeID( context, SladeIDConfig( serviceUrl = "https://id.example.com/api/v1", auth = ClientCredentialsAuth( clientId = BuildConfig.SLADEID_CLIENT_ID, clientSecret = BuildConfig.SLADEID_CLIENT_SECRET, ), // encryptBiometrics defaults to true (encrypted); set false to send base64 ), )

Keep credentials out of source control — inject them at build time (e.g. from local.properties into BuildConfig). See Authentication.

Next