Skip to content
/ android-biometric Public template

Android biometric library inspired from androidx.biometric for non androidx apps.

License

Notifications You must be signed in to change notification settings

exxbrain/android-biometric

Repository files navigation

Android CI

Android biometric

Android biometric library inspired from androidx.biometric for non androidx apps.

How to

Get to your project:

allprojects {
    repositories {
        //...
        maven { url 'https://jitpack.io' }
    }
}
dependencies {
    implementation 'com.github.exxbrain:android-biometric:{Version}'
    //...
}

Features

canAuthenticate

int error = BiometricManager.from(MainActivity.this).canAuthenticate();
if (error != BiometricManager.BIOMETRIC_SUCCESS) {
    /// Can't authenticate at all
}

authenticate

BiometricPrompt.AuthenticationCallback authenticationCallback = 
         new BiometricPrompt.AuthenticationCallback() {
              //...
         };

BiometricPrompt biometricPrompt = 
         new BiometricPrompt(MainActivity.this, executor, authenticationCallback);

BiometricPrompt.PromptInfo promptInfo = new BiometricPrompt.PromptInfo.Builder()
        .setTitle("Set the title to display.")
        .setSubtitle("Set the subtitle to display.")
        .setDescription("Set the description to display")
        .setNegativeButtonText("Negative Button")
        .build();

mBiometricPrompt.authenticate(promptInfo);

Example App

Checkout and look at example app

About

Android biometric library inspired from androidx.biometric for non androidx apps.

Resources

License

Stars

Watchers

Forks

Packages

No packages published