Coder Social home page Coder Social logo

aks-4125 / nativebiometricscanner Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 1.0 168 KB

Android BiometricPrompt introduced in Android Pie

Home Page: https://aks-4125.github.io/NativeBiometricScanner/

Kotlin 100.00%
android biometricprompt biometric-identification biometricpromptapi kotlin-android

nativebiometricscanner's Introduction

NativeBiometricScanner

Android BiometricPrompt introduced in Android Pie

Before Android 9 Pie, your options to implement a fingerprint scanning dialog were:

  • Build your own from scratch
  • Copy Google's sample implementation
  • Use some unofficial library

Unfortunately neither of those options are great. Unless of course you have really specific UI requirements and need to build your own. But for most applications it's enough to have a generic dialog and it'd be great to have an official one.

Luckily, since Android 9 Pie, Google has introduced the BiometricPrompt that addresses this issue. Hopefully this post will help you integrate it.

Using the BiometricPrompt builder we can:

setTitle() — Set the title to display (Required)

setSubtitle() — Set the subtitle to display (Optional)

setDescription() — Set the description to display(Optional)

setNegativeButton() — Set the text for the negative button(Required). 

You must also provide an Executor instance and a click listener for the negative button.

Note: You can’t customise the icon or error message that are used within the dialog.

implementation 'androidx.biometric:biometric:1.0.0-alpha04'

There are other bio-metric detection schemes that are beginning to appear, such as more advanced facial recognition, and there are potentially others that may begin appearing soon.

Dialog

Result

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.