FingerprintDialogCompat
FingerprintDialog from Android 28 (P) back ported to Android 23 (M).
Why do we need this libraryinterrobang
-
Fingerprint is currently the most secure and most user friendly way of authenticating the user in Android.
-
Android provides different APIs to deal with the fingerprint authentication. These APIs changed overtime.
Android versions below API 23 did not support fingerprint hardware at all.
Android versions between API 23 and API 27, uses FingerprintManager for fingerprint authentication. Developer has to manually authenticate by implementing bunch of APIs.
Android version above API 28, uses FingerprintDialog for fingerprint authentication. -
Due to the Android fragmentation developer has to implement all those APIs based on the android version.pensive It makes managing fingerprint authentication very hard.
-
This library aims to simplify fingerprint authentication by providing backport of the FingerprintDialog from Android P and provides single public APIs for the authentication all the way to API 14. So as a developer you don't have to deal with the complexity of dealing with different APIs.
Features:
- Extremely lightweight.
- Backport of FingerprintDialog from Android P, provides same fingerprint authentication on all Android versions.
- Easy to integrate. All you have to do is implement the builder and you are done. The library will take care of authentication based on the device's android version.
- Classifies different error codes provided by the Android framework and wraps them into different error callbacks for easy error handling.
How to use this library?
-
Gradle dependency:
- Add below dependency into your build.gradle file.
-
Prepare the builder.
- Create the
FingerprintDialogBuilder
and provide the title, subtitle and the description. Application should explain why they need to access user's fingerprint.
Java:
Kotlin:
- Create the
-
Implement callbacks and show the dialog.
- Implement the
AuthenticationCallback
to get callbacks for error or success from the fingerprint authentication dialog.
Java:
Kotlin:
- Show the dialog and start fingerprint authentication.
Java:
Kotlin:
- Implement the