A touchless fingerprint biometric capture SDK for Android that uses AI-powered hand detection to capture and process fingerprint images.
| Requirement | Version |
|---|---|
| Android SDK | 24+ (Android 7.0 Nougat) |
| Kotlin | 1.7.10+ |
| Camera | Required |
| Network | Required for processing |
Add the JitPack repository to your project's settings.gradle (or settings.gradle.kts):
Groovy (settings.gradle):
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {
url = uri("https://jitpack.io")
credentials {
username = "YOUR_JITPACK_TOKEN"
password = ""
}
}
}
}Kotlin DSL (settings.gradle.kts):
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {
url = uri("https://jitpack.io")
credentials {
username = "YOUR_JITPACK_TOKEN"
password = ""
}
}
}
}Note: Replace YOUR_JITPACK_TOKEN with the token provided by the SDK vendor.
Add the SDK dependency to your app's build.gradle:
Groovy:
dependencies {
implementation 'com.github.RMS-Techknowledgy-Private-Limited:biometrics-sdk:1.0.3'
}Kotlin DSL:
dependencies {
implementation("com.github.RMS-Techknowledgy-Private-Limited:biometrics-sdk:1.0.3")
}Sync your Gradle files to download the SDK.
import com.biometrics.Biometrics
import com.biometrics.model.BiometricsResult
class MainActivity : AppCompatActivity() {
// Register the SDK launcher
private val biometricsLauncher = Biometrics.register(this) { result ->
handleResult(result)
}
private fun handleResult(result: BiometricsResult) {
when (result) {
is BiometricsResult.Success -> {
// Fingerprints captured successfully
val batchId = result.batchId
val files = result.processedFiles
files.forEach { file ->
Log.d("Biometrics", "Finger: ${file.original_name}")
Log.d("Biometrics", "PNG URL: ${file.processed_png}")
Log.d("Biometrics", "WSQ URL: ${file.processed_wsq}")
}
}
is BiometricsResult.Error -> {
// Handle error
Log.e("Biometrics", "Error: ${result.message}")
}
is BiometricsResult.Cancelled -> {
// User cancelled the capture
Log.d("Biometrics", "Capture cancelled by user")
}
}
}
fun startFingerprintCapture() {
// Launch with your authentication token
biometricsLauncher.launch("your-auth-token")
}
}import com.biometrics.Biometrics
import com.biometrics.model.BiometricsResult
class MyFragment : Fragment() {
private val biometricsLauncher = Biometrics.register(this) { result ->
when (result) {
is BiometricsResult.Success -> handleSuccess(result)
is BiometricsResult.Error -> handleError(result)
is BiometricsResult.Cancelled -> handleCancelled()
}
}
fun captureBiometrics(token: String) {
biometricsLauncher.launch(token)
}
}The main entry point for the SDK.
object Biometrics {
/**
* Register the SDK with an Activity
* @param activity The host ComponentActivity
* @param onResult Callback for capture results
* @return BiometricsLauncher instance
*/
fun register(
activity: ComponentActivity,
onResult: (BiometricsResult) -> Unit
): BiometricsLauncher
/**
* Register the SDK with a Fragment
* @param fragment The host Fragment
* @param onResult Callback for capture results
* @return BiometricsLauncher instance
*/
fun register(
fragment: Fragment,
onResult: (BiometricsResult) -> Unit
): BiometricsLauncher
}Controls the biometrics capture flow.
class BiometricsLauncher {
/**
* Launch the fingerprint capture flow
* @param token Authentication token for API access
*/
fun launch(token: String)
}A sealed class representing the capture outcome.
sealed class BiometricsResult {
/**
* Capture completed successfully
*/
data class Success(
val batchId: String, // Unique batch identifier
val processedFiles: List<ProcessedFile>, // Captured fingerprints
val parameters: ProcessingParams? // Processing settings used
) : BiometricsResult()
/**
* An error occurred during capture
*/
data class Error(
val message: String // Error description
) : BiometricsResult()
/**
* User cancelled the capture
*/
object Cancelled : BiometricsResult()
}Details of a processed fingerprint file.
data class ProcessedFile(
val original_name: String, // e.g., "RIGHT_INDEX.png"
val captured_png: String?, // Original captured image URL (if available)
val processed_png: String, // Processed PNG image URL
val processed_wsq: String // Processed WSQ file URL (FBI standard)
)Processing parameters used for the capture.
data class ProcessingParams(
val thickness: Int = 2, // Ridge thickness (1=thin, 2=medium, 3=thick)
val margin: Int = 20, // Edge mask margin in pixels
val crop: Boolean = true, // Auto-crop to fingerprint region
val dpi: Int = 500, // Output resolution
val block_size: Int = 16 // Processing block size
)The SDK captures 4 fingers from the right hand:
| Finger |
|---|
| RIGHT_INDEX |
| RIGHT_MIDDLE |
| RIGHT_RING |
| RIGHT_LITTLE |
The SDK requires the following permissions. Add them to your AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Required Permissions -->
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- Required Features -->
<uses-feature android:name="android.hardware.camera" android:required="true" />
</manifest>Note: The SDK handles runtime camera permission requests internally.
package com.example.myapp
import android.os.Bundle
import android.widget.Button
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.biometrics.Biometrics
import com.biometrics.model.BiometricsResult
class MainActivity : AppCompatActivity() {
private val biometricsLauncher = Biometrics.register(this) { result ->
when (result) {
is BiometricsResult.Success -> {
Toast.makeText(
this,
"Captured ${result.processedFiles.size} fingerprints",
Toast.LENGTH_SHORT
).show()
// Process the results
result.processedFiles.forEach { file ->
println("Finger: ${file.original_name}")
println("PNG: ${file.processed_png}")
println("WSQ: ${file.processed_wsq}")
}
}
is BiometricsResult.Error -> {
Toast.makeText(
this,
"Error: ${result.message}",
Toast.LENGTH_LONG
).show()
}
is BiometricsResult.Cancelled -> {
Toast.makeText(
this,
"Capture cancelled",
Toast.LENGTH_SHORT
).show()
}
}
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
findViewById<Button>(R.id.captureButton).setOnClickListener {
startCapture()
}
}
private fun startCapture() {
val authToken = getAuthToken() // Your authentication logic
biometricsLauncher.launch(authToken)
}
private fun getAuthToken(): String {
// Implement your token retrieval logic
return "your-auth-token"
}
}| Issue | Solution |
|---|---|
| Token verification failed | Verify your authentication token is valid and not expired |
| Camera permission denied | Ensure camera permission is granted; the SDK will request it |
| Network error | Check internet connectivity and server availability |
| No hand detected | Ensure adequate lighting and position hand properly in frame |
| Low quality capture | Improve lighting conditions and hold hand steady |
If you encounter dependency conflicts, try adding the following to your build.gradle:
android {
packagingOptions {
pickFirst 'META-INF/DEPENDENCIES'
pickFirst 'META-INF/LICENSE'
pickFirst 'META-INF/LICENSE.txt'
}
}For technical support or to obtain an authentication token, contact the SDK provider.
| Version | Notes |
|---|---|
| 1.0.3 | Initial release |