An open API service indexing awesome lists of open source software.

https://github.com/lopspower/biometric

The easiest way is to use the new version of Biometric under AndroidX 🔒
https://github.com/lopspower/biometric

android androidx biometric

Last synced: 3 months ago
JSON representation

The easiest way is to use the new version of Biometric under AndroidX 🔒

Awesome Lists containing this project

README

          

Biometric
=================

sample

[![Platform](https://img.shields.io/badge/platform-android-green.svg)](http://developer.android.com/index.html)
[![API](https://img.shields.io/badge/API-16%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=16)
[![Maven Central](https://img.shields.io/maven-central/v/com.mikhaellopez/biometric.svg?label=Maven%20Central)](https://search.maven.org/artifact/com.mikhaellopez/biometric)
[![Twitter](https://img.shields.io/badge/Twitter-@LopezMikhael-blue.svg?style=flat)](http://twitter.com/lopezmikhael)

The easiest way is to use the new version of [Biometric](https://developer.android.com/jetpack/androidx/releases/biometric) under [AndroidX](https://developer.android.com/jetpack/androidx).

You can easily know if the device allows you to use Biometric and under what type (FACE, FINGERPRINT, IRIS, MULTIPLE...). The library also provides a [CryptoObject](https://developer.android.com/reference/android/hardware/biometrics/BiometricPrompt.CryptoObject) implementation if you want to implement it on your side on [CryptoHelper](/biometric/src/main/java/com.mikhaellopez.biometric/CryptoHelper.kt).


Android app on Google Play

USAGE
-----

To used this usefull library you can grab it via Gradle:

```groovy
implementation 'com.mikhaellopez:biometric:1.1.0'
```

KOTLIN
-----

```kotlin
val biometricHelper = BiometricHelper(fragment)

// BiometricType = FACE, FINGERPRINT, IRIS, MULTIPLE or NONE
val biometricType: BiometricType = biometricHelper.getBiometricType()

// Check if biometric is available on the device
btnStart.visibility = if (biometricHelper.biometricEnable()) View.VISIBLE else View.GONE

btnStart.setOnClickListener {
biometricHelper.showBiometricPrompt(
BiometricPromptInfo(
title = "Title", // Mandatory
negativeButtonText = "Cancel", // Mandatory
subtitle = "Subtitle",
description = "Description",
confirmationRequired = true
)
) {
// Do something when success

}
}
```

You can also handle error and failed like this:

```kotlin
biometricHelper.showBiometricPrompt(promptInfo,
onError = { errorCode: Int, errString: CharSequence ->
// Do something when error

}, onFailed = {
// Do something when failed

}, onSuccess = { result: BiometricPrompt.AuthenticationResult ->
// Do something when success

})
```

DEMO
-----

| Dark Mode | Biometric Fingerprint | Old Fingerprint |
| ----------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| sample | sample | sample |

SUPPORT ❤️
-----

Find this library useful? Support it by joining [**stargazers**](https://github.com/lopspower/Biometric/stargazers) for this repository ⭐️


And [**follow me**](https://github.com/lopspower?tab=followers) for my next creations 👍

LICENCE
-----

Biometric by [Lopez Mikhael](http://mikhaellopez.com/) is licensed under a [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).