Skip to content
The easiest way is to use the new version of Biometric under AndroidX πŸ”’
Kotlin
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
biometric-example Update deps Jan 13, 2020
biometric Update comment Jan 18, 2020
gradle/wrapper Create Biometric lib Jan 6, 2020
preview Add header Jan 12, 2020
.gitignore Initial commit Jan 6, 2020
LICENSE Add License Jan 7, 2020
README.md Update README.md Jan 12, 2020
build.gradle Update deps Jan 13, 2020
dependencies.gradle Update deps Jan 13, 2020
gradlew Initial commit Jan 6, 2020
gradlew.bat Initial commit Jan 6, 2020
settings.gradle Create Biometric lib Jan 6, 2020

README.md

Biometric

sample

Platform API Download
Twitter Codacy Badge

The easiest way is to use the new version of Biometric under 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 implementation if you want to implement it on your side on CryptoHelper.

Android app on Google Play

USAGE

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

implementation 'com.mikhaellopez:biometric:1.0.1'

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:

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 for this repository ⭐️
And follow me for my next creations πŸ‘

LICENCE

Biometric by Lopez Mikhael is licensed under a Apache License 2.0.

You can’t perform that action at this time.