Skip to content

imattaullah/Biometric-App-Lock-Sample

 
 

Repository files navigation

Biometric-App-Lock

Add Biometric Authentication to any Android app

This application uses android Biometric Prompt Library to authenticate user using fingerprint.

API

Main Part

How to integrate the library in your app?

Gradle Dependecy
dependencies {
        implementation 'androidx.biometric:biometric:1.0.0-alpha03'
}

Usage

new BiometricPrompt.PromptInfo.Builder()
                .setTitle("Login")
                .setSubtitle("Login to your account!")
                .setDescription("Place your finger on the device home button to verify your identity")
                .setNegativeButtonText("CANCEL")
                .build();

The BiometricPrompt class has the following callback methods:

new BiometricPrompt(activity, executor, new BiometricPrompt.AuthenticationCallback() {
            @Override
            public void onAuthenticationError(int errorCode, @NonNull CharSequence errString) {
                super.onAuthenticationError(errorCode, errString);
                // ................
            }

            @Override
            public void onAuthenticationSucceeded(@NonNull BiometricPrompt.AuthenticationResult result) {
                super.onAuthenticationSucceeded(result);
                // .............
            }

            @Override
            public void onAuthenticationFailed() {
                super.onAuthenticationFailed();
               // ................
            }
        });

About

This android app is a demonstration of using fingerprint authentication to get access to the application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Java 100.0%