Developer Documentation

Alaqan Mini SDK
for Android

Integrate palm vein biometric authentication into your Android applications with our secure, easy-to-use SDK.

Version 1.0.0 December 2025 Android 7.0+

Introduction

The Alaqan Mini SDK enables Android applications to integrate palm vein biometric authentication using the Alaqan Mini hardware device. The SDK provides a secure, easy-to-use interface for user registration and identification through contactless palm recognition technology.

High Security

Multi-spectral imaging with liveness detection for enterprise-grade security.

Fast Recognition

Sub-second identification performance for seamless user experience.

Easy Integration

Simple API with comprehensive callbacks and clear documentation.

Contactless

Hygienic palm vein recognition without physical contact.

Use Cases

  • Point of Sale (POS) authentication
  • Banking and financial services
  • Access control systems
  • Time and attendance tracking
  • Identity verification

Requirements

Hardware

ComponentRequirement
DeviceAlaqan Mini Palm Scanner
ConnectionUSB Type-C
Host DeviceAndroid device with OTG support

Software

ComponentRequirement
Android SDKMinimum API Level 24 (Android 7.0 Nougat)
Target SDKAPI Level 31 (Android 12) recommended
Architecturearm64-v8a, armeabi-v7a

Network

  • Active internet connection required for SDK operations
  • Minimum bandwidth: 1 Mbps recommended

Installation

1

Add the SDK to Your Project

Add the Alaqan Mini SDK AAR file to your project's libs directory:

app/
├── libs/
│   └── alaqan-mini-sdk-1.0.0.aar
├── src/
└── build.gradle
2

Configure Gradle

Add the following to your app-level build.gradle:

android {
    defaultConfig {
        minSdk 24
        ndk {
            abiFilters 'arm64-v8a', 'armeabi-v7a'
        }
    }
}

dependencies {
    implementation files('libs/alaqan-mini-sdk-1.0.0.aar')
}
3

Configure USB Device Filter

Create res/xml/device_filter.xml:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <usb-device vendor-id="17992" product-id="65280" />
</resources>
4

Update AndroidManifest.xml

Add the required permissions and USB configuration:

<manifest>
    <uses-feature android:name="android.hardware.usb.host" android:required="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application>
        <activity android:name=".MainActivity">
            <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>
</manifest>

Quick Start

Here's a minimal example to get you started with the Alaqan Mini SDK:

class MainActivity : AppCompatActivity(), AlaqanMiniListener {
    private lateinit var sdk: AlaqanMiniSDK

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        sdk = AlaqanMiniSDK.getInstance()
        val errorCode = sdk.initialize(this, "YOUR_API_KEY")
        if (errorCode != 0) { Log.e("Alaqan", "Init failed: $errorCode"); return }
        sdk.setListener(this)
    }

    override fun onResume() { super.onResume(); sdk.connect() }
    override fun onPause() { super.onPause(); sdk.disconnect() }
    override fun onDestroy() { super.onDestroy(); sdk.destroy() }

    override fun onDeviceConnected() {
        Log.d("Alaqan", "Device connected: ${sdk.serialNumber}")
    }

    override fun onIdentifyFinish(result: IdentifyResult) {
        when (result.status) {
            IdentifyStatus.SUCCESS -> Log.d("Alaqan", "Identified: ${result.userId}")
            IdentifyStatus.NOT_FOUND -> Log.d("Alaqan", "Not recognized")
        }
    }
}

SDK Architecture

Your Application
UI/UX, Business Logic
Alaqan Mini SDK
Device Management, Biometric Operations
Alaqan Mini Device
Palm Biometric Scanner

Lifecycle Management

The SDK follows Android lifecycle best practices. All callbacks are delivered on the main (UI) thread.

App StateRecommended SDK Action
onCreate()initialize()
onResume()connect()
onPause()disconnect()
onDestroy()destroy()

API Reference

Initialization

initialize()

Initializes the SDK with the application context and API credentials.

fun initialize(context: Context, apiKey: String): Int

Returns: Int — Error code (0 if successful)

CodeDescription
0Initialization successful
4001No internet connection
6001Invalid API key
6002API key expired
6003License expired

Connection Management

connect()

Initiates connection to the Alaqan Mini device.

fun connect(): Boolean

disconnect()

Disconnects from the Alaqan Mini device.

fun disconnect()

isConnected

val isConnected: Boolean

Device Information

val serialNumber: String?     // e.g., "GX4TYQWH3D"
val firmwareVersion: String?  // e.g., "1.2.3"

Registration

startRegister()

Starts the palm registration process for a new user. The SDK captures 3 palm images.

fun startRegister(): Boolean

Callbacks: onRegisterProgress(), onCaptureFeedback(), onRegisterFinish()

stopRegister()

fun stopRegister()

Identification

startIdentify()

Starts the palm identification process.

fun startIdentify(): Boolean

Callbacks: onCaptureFeedback(), onIdentifyFinish()

stopIdentify()

fun stopIdentify()

Configuration

setTimeout()

fun setTimeout(operationType: OperationType, timeoutMs: Long)
OperationDefault Timeout
REGISTRATION30,000 ms
IDENTIFICATION15,000 ms

Callbacks & Listeners

interface AlaqanMiniListener {
    fun onDeviceConnected()
    fun onDeviceDisconnected()
    fun onRegisterProgress(progress: RegisterProgress)
    fun onRegisterFinish(result: RegisterResult)
    fun onIdentifyFinish(result: IdentifyResult)
    fun onCaptureFeedback(feedback: CaptureFeedback)
    fun onError(error: AlaqanError)
}

Data Models

data class RegisterResult(
    val status: RegisterStatus,  // SUCCESS, DUPLICATE, FAILED, CANCELLED, TIMEOUT
    val userId: String?,
    val errorCode: Int?,
    val errorMessage: String?
)

data class IdentifyResult(
    val status: IdentifyStatus,  // SUCCESS, NOT_FOUND, FAILED, CANCELLED, TIMEOUT
    val userId: String?,
    val confidence: Float?,     // 0.0-1.0
    val errorCode: Int?,
    val errorMessage: String?
)

data class CaptureFeedback(
    val status: CaptureStatus,
    val guidance: CaptureGuidance?,  // MOVE_CLOSER, MOVE_FARTHER, CENTER_PALM, etc.
    val qualityScore: Float
)

Error Codes

Connection (1000-1099)

CodeConstantDescription
1001ERROR_DEVICE_NOT_FOUNDDevice not detected
1002ERROR_USB_PERMISSION_DENIEDUSB permission not granted
1003ERROR_CONNECTION_FAILEDFailed to connect
1004ERROR_DEVICE_DISCONNECTEDDevice disconnected
1005ERROR_DEVICE_BUSYDevice busy

Registration (2000-2099)

CodeConstantDescription
2001ERROR_REGISTRATION_IN_PROGRESSAlready running
2002ERROR_CAPTURE_FAILEDCapture failed
2003ERROR_QUALITY_TOO_LOWQuality insufficient
2004ERROR_DUPLICATE_PALMAlready registered
2005ERROR_REGISTRATION_TIMEOUTTimed out
2006ERROR_REGISTRATION_FAILEDFailed

Identification (3000-3099)

CodeConstantDescription
3001ERROR_IDENTIFICATION_IN_PROGRESSAlready running
3002ERROR_CAPTURE_FAILEDCapture failed
3003ERROR_QUALITY_TOO_LOWQuality insufficient
3004ERROR_IDENTIFICATION_TIMEOUTTimed out
3005ERROR_IDENTIFICATION_FAILEDFailed

Network (4000-4099)

CodeConstantDescription
4001ERROR_NETWORK_UNAVAILABLENo internet
4002ERROR_SERVICE_UNAVAILABLEService unavailable
4003ERROR_REQUEST_TIMEOUTRequest timed out

License (6000-6099)

CodeConstantDescription
6001ERROR_API_KEY_INVALIDInvalid API key
6002ERROR_API_KEY_EXPIREDAPI key expired
6003ERROR_LICENSE_EXPIREDLicense expired
6004ERROR_QUOTA_EXCEEDEDQuota exceeded

General (9000-9099)

CodeConstantDescription
9001ERROR_SDK_NOT_INITIALIZEDNot initialized
9002ERROR_INVALID_PARAMETERInvalid parameter
9003ERROR_OPERATION_CANCELLEDCancelled
9999ERROR_UNKNOWNUnknown error

Best Practices

Tip

Always check isConnected before starting registration or identification operations.

Error Handling

override fun onError(error: AlaqanError) {
    when (error.code) {
        in 1000..1099 -> handleConnectionError(error)
        in 2000..2099 -> handleRegistrationError(error)
        in 3000..3099 -> handleIdentificationError(error)
        in 4000..4099 -> handleNetworkError(error)
        in 6000..6099 -> handleLicenseError(error)
        else -> handleGeneralError(error)
    }
}

Troubleshooting

Device Not Detected

Symptoms: onDeviceConnected() never called, ERROR_DEVICE_NOT_FOUND

  • Verify Alaqan Mini is properly connected
  • Check USB OTG is enabled on the Android device
  • Verify device_filter.xml contains correct VID/PID values
  • Try a different USB cable

USB Permission Denied

Symptoms: ERROR_USB_PERMISSION_DENIED

  • Ensure USB permission dialog is shown and accepted
  • Check that your Activity handles USB intents correctly
  • Clear app data and try again

SDK Initialization Fails

Symptoms: initialize() returns non-zero

  • Verify API key is correct
  • Ensure active internet connection
  • Check that API key has not expired
  • Check logcat for detailed error messages

Sample Implementation

Contact Alaqan support for a complete sample project with full source code.

Support

Technical Support

support@alaqan.com

Business Inquiries

sales@alaqan.com

When Reporting Issues

Include: Error code, steps to reproduce, device serial number, and SDK version.