Q818 Device Fingerprint SDK Plugin for Flutter
This Flutter plugin provides a simple bridge to native Q818 fingerprint hardware SDKs using Platform Channels.
It allows developers to capture fingerprint images, generate templates (ISO/ANSI), and perform template matching.
β¨ Features
- Open and close the fingerprint device
- Capture fingerprint images
- Generate ISO and ANSI templates
- Compare fingerprint templates for matching
- Works with custom hardware SDKs via native integration (Java/Kotlin, Swift/Objective-C)
π¦ Installation
Add the dependency in your Flutter project:
dependencies:
fingerprint_sdk:
path: ./fingerprint_sdk
Then run:
flutter pub get
βΈ»
π Usage
Import the plugin:
import 'package:fingerprint_sdk/fingerprint_sdk.dart';
Example
final sdk = FingerprintSdk();
// Open device
final handle = await sdk.openDevice();
print("Device Handle: $handle");
// Capture fingerprint image
final imageBase64 = await sdk.captureImage();
print("Captured Image (Base64): $imageBase64");
// Create ISO template
final isoTemplate = await sdk.createISOTemplate(imageBase64!);
print("ISO Template: $isoTemplate");
// Create ANSI template
final ansiTemplate = await sdk.createANSITemplate(imageBase64);
print("ANSI Template: $ansiTemplate");
// Compare templates
final score = await sdk.compareTemplates(isoTemplate!, ansiTemplate!);
print("Match Score: $score");
// Close device
await sdk.closeDevice();
βΈ»
π Project Structure
fingerprint_sdk/
ββ .dart_tool/
β ββ extension_discovery/
β β ββ README.md
β β ββ vs_code.json
β ββ package_config.json
β ββ package_graph.json
β ββ version
ββ android/
β ββ gradle/
β β ββ wrapper/
β β ββ gradle-wrapper.properties
β ββ src/
β β ββ main/
β β β ββ java/
β β β β ββ com/
β β β β ββ example/
β β β β β ββ fingerprint_sdk/
β β β β β ββ FingerprintSdkPlugin.java
β β β β ββ HZFINGER/
β β β β ββ HAPI.java
β β β β ββ HostUsb.java
β β β β ββ LAPI.java
β β β ββ jniLibs/
β β β β ββ arm64-v8a/
β β β β β ββ libbiofp_e_lapi.so
β β β β β ββ libcheckLive.so
β β β β β ββ libFingerILA.so
β β β β ββ armeabi/
β β β β β ββ libbiofp_e_lapi.so
β β β β β ββ libcheckLive.so
β β β β β ββ libFingerILA.so
β β β β ββ armeabi-v7a/
β β β β ββ libbiofp_e_lapi.so
β β β β ββ libcheckLive.so
β β β β ββ libFingerILA.so
β β β ββ kotlin/
β β β β ββ com/
β β β β ββ example/
β β β β ββ fingerprint_sdk/
β β β β ββ FingerprintSdkPlugin.kt
β β β β ββ FingerprintSdkPlugin.txt
β β β ββ AndroidManifest.xml
β β ββ test/
β β ββ kotlin/
β β ββ com/
β β ββ example/
β β ββ fingerprint_sdk/
β β ββ FingerprintSdkPluginTest.kt
β ββ .gitignore
β ββ build.gradle
β ββ fingerprint_sdk_android.iml
β ββ local.properties
β ββ settings.gradle
ββ example/
ββ lib/
β ββ fingerprint_sdk_method_channel.dart
β ββ fingerprint_sdk_platform_interface.dart
β ββ fingerprint_sdk.dart
ββ test/
β ββ fingerprint_sdk_method_channel_test.dart
β ββ fingerprint_sdk_test.dart
ββ .gitignore
ββ .metadata
ββ analysis_options.yaml
ββ CHANGELOG.md
ββ fingerprint_sdk.iml
ββ LICENSE
ββ pubspec.lock
ββ pubspec.yaml
ββ README.md
βΈ»
βοΈ API Reference
Method | Parameters | Returns | Description |
---|---|---|---|
openDevice() |
none | Future<int?> |
Opens the fingerprint device, returning a handle or null if it fails. |
captureImage() |
none | Future<String?> |
Captures a fingerprint image and returns it as a Base64-encoded string. |
createISOTemplate() |
String imageBase64 |
Future<String?> |
Generates an ISO fingerprint template from a captured image. |
createANSITemplate() |
String imageBase64 |
Future<String?> |
Generates an ANSI fingerprint template from a captured image. |
compareTemplates() |
String t1, String t2 |
Future<int?> |
Compares two templates and returns a similarity score. |
closeDevice() |
none | Future<int?> |
Closes the fingerprint device. |
π§ Platform Support
- Android: Implemented via
FingerprintSdkPlugin.java
- iOS: Implementation pending (Swift/Objective-C)
π Development Notes
- Ensure native SDK libraries required by your fingerprint hardware (such as
.so
,.dll
, or.framework
files) are correctly integrated into your Android/iOS projects. - This plugin communicates between Dart and native code using Flutterβs MethodChannel (
fingerprint_sdk
). - The ISO and ANSI templates are returned as Base64-encoded strings for easy storage and transmission.
πΌ Workflow Overview
Fingerprint Device
β
Capture Image (Base64)
β
Generate Template (ISO / ANSI)
β
Store or Compare Templates
π License
This project is licensed under the MIT License. Use it at your own risk and ensure compliance with your hardware vendorβs SDK terms.