Coder Social home page Coder Social logo

vijo / android-fingerprint-authentication Goto Github PK

View Code? Open in Web Editor NEW

This project forked from msoftware/android-fingerprint-authentication

0.0 2.0 0.0 3.69 MB

A library that allows you to easily integrate and manage fingerprint authentication in your app.

License: MIT License

Java 100.00%

android-fingerprint-authentication's Introduction

Android Arsenal Download ![Size](https://img.shields.io/badge/Size-20 KB-e91e63.svg) Build Status

Fingerprint Authentication Helper

Finger print authentication helper is an android library to simplify the authentication with finger print process. This will provide a common platform for finger print authentication for all the android versions.

##Screenshot Authentication Demo

##Dependency

  • Add the dependencies to your app level build.gradle file:
dependencies {
    compile 'com.multidots:fingerprint-auth:1.0.1'
}

##Usage

  • Inside your activity or fragment create FingerPrintAuthHelper instance and call startAuth() in the onResume() to enable finger print scanning.
@Override
protected void onCreate(Bundle savedInstanceState) {
    mFingerPrintAuthHelper = FingerPrintAuthHelper.getHelper(this, this);
    //.... 
    //....        
}
   
@Override
protected void onResume() {
    super.onResume();
    //start finger print authentication
    mFingerPrintAuthHelper.startAuth();
}
  • Don't forget to disable the finger print scanner in onPause() of your activity/fragment.
@Override
protected void onPause() {
    super.onPause();
    mFingerPrintAuthHelper.stopAuth();
}

Callbacks

  • You need to implement FingerPrintAuthCallback in your activity/fragment to receive the callbacks from the helper class.
@Override
public void onNoFingerPrintHardwareFound() {
    //Device does not have finger print scanner.
}

@Override
public void onNoFingerPrintRegistered() {
    //There are no finger prints registered on this device.
}

@Override
public void onBelowMarshmallow() {
    //Device running below API 23 version of android that does not support finger print authentication.
}

@Override
public void onAuthSuccess(FingerprintManager.CryptoObject cryptoObject) {
    //Authentication sucessful.
}

@Override
public void onAuthFailed(int errorCode, String errorMessage) {
    switch (errorCode) {    //Parse the error code for recoverable/non recoverable error.
        case AuthErrorCodes.CANNOT_RECOGNIZE_ERROR:
            //Cannot recognize the fingerprint scanned.
            break;
        case AuthErrorCodes.NON_RECOVERABLE_ERROR:
            //This is not recoverable error. Try other options for user authentication. like pin, password.
            break;
        case AuthErrorCodes.RECOVERABLE_ERROR:
            //Any recoverable error. Display message to the user.
            break;
    }
}

##Demo application Here is the link to the demo application.

##Questions?

  • If you have some problems with using this library or something doesn't work correctly, feel free to open an issue.

##How to contribute? ####Simple 3 step to contribute into this repo:

  1. Fork the project.
  2. Make required changes and commit.
  3. Generate pull request. Mention all the required description regarding changes you made.

###Medium Article

android-fingerprint-authentication's People

Contributors

kevalpatel2106 avatar

Watchers

 avatar  avatar

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.