FingerprintAuthHelper


Source link: https://github.com/pro100svitlo/FingerprintAuthHelper

FingerprintAuthHelper

A small library that allows You to easily manage fingererprint authentication inside your Activity or Fragment on devices with fingerprint scanner and Android M and higher. Min sdk version 14.

  1. Demo app
  2. Usage
  3. Documentation
  4. ChangeLog
  5. Questions and help
  6. License

Usage

Add the dependencies to your gradle file:
 dependencies {

compile 'com.github.pro100svitlo:fingerprintAuthHelper:1.3.0'
  
}
Inside your activity or fragment:
 private FingerprintAuthHelper mFAH;

@Override
  protected void onCreate(Bundle savedInstanceState) {

  ...

mFAH = new FingerprintAuthHelper

  .Builder(this, this) //(Context inscance of Activity, FahListener)

  .build();

 if (mFAH.isHardwareEnable()){

 //do some stuff here

}
 else {

 //otherwise do

}

  
}

...
  @Override
  protected void onResume() {

super.onResume();

mFAH.startListening();

  
}

...

@Override
  protected void onStop() {

super.onStop();

mFAH.stopListening();

  
}

...

@Override
  protected void onDestroy() {

super.onDestroy();

mFAH.onDestroy();

  
}

@Override
  public void onFingerprintStatus(boolean authSuccessful, int errorType, CharSequence errorMess) {

// authSuccessful - boolean that shows auth status

// errorType - if auth was failed, you can catch error type

// errorMess - if auth was failed, errorMess will tell you (and user) the reason

 if (authSuccessful){

 // do some stuff here in case auth was successful

}
 else if (mFAH != null){

  // do some stuff here in case auth failed

 switch (errorType){

  case FahErrorType.General.LOCK_SCREEN_DISABLED:

  case FahErrorType.General.NO_FINGERPRINTS:

mFAH.showSecuritySettingsDialog();

break;

  case FahErrorType.Auth.AUTH_NOT_RECOGNIZED:

//do some stuff here

break;

  case FahErrorType.Auth.AUTH_TO_MANY_TRIES:

//do some stuff here

break;

 
}

}

  
}

@Override
  public void onFingerprintListening(boolean listening, long milliseconds) {

// listening - status of fingerprint listen process

// milliseconds - timeout value, will be > 0, if listening = false & errorType = AUTH_TO_MANY_TRIES

 if (listening){

 //add some code here

}
 else {

 //add some code here

}

if (milliseconds > 0) {

 //if u need, u can show timeout for user

}

  
}

That's pretty much all what you need to start the work! Full documentation and all options descriptions you can find here.


ChangeLog

  • v.1.3.0 //great thanks Boris Rosenow for helping with this release!
    1. kotlin style refactoring
    2. fix bug with multiple calling tryToStopMe()
    3. some library API updates (add few new and few deprecated methods)
  • v.1.2.2
    1. updated gradle version, Android SDK, .gitignore, kotlin version
    2. fixed known issue with Samsung firmware
  • v.1.2.1
    1. refactoring
  • v.1.2.0
    1. stability improvements
  • v.1.1.7
    1. new function cleanTimeOut() - in case you authinticate with other method. More details in docs.
    2. remove possibility to set max try count (becouse Fingerprint API update :)
    3. now on Kotlin :)
    4. refactoring
  • v.1.1.5
    1. refactoring
    2. small bugfix
  • v.1.1.4
    1. fix crashes on Sumsung devices
    2. add method isFingerprintEnrolled() to FingerprintAuthHelper
    3. small bugfix
  • v.1.1.3
    1. init context must be instance of Activity
    2. add method showSecuritySettingsDialog() to FingerprintAuthHelper
    3. add help error
  • v.1.1.2
    1. add possibility to set max count of tries

Questions and help

If you have some problems with using this library or something doesn't work correctly - just write me an email and describe your question or problem. I will try to do my best to help you and fix the problem if it exists. Here is my email: [email protected]. Or you also can leave an issue here.

License

The MIT License (MIT)

Copyright (c) 2016 FingerprintAuthHelper

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Resources

This project allows to create pretty sticker views.

Periscope like HeartLayout.

This library adds a layer on top of SQLBrite by providing basically two modules:

  • ObjectMapper
  • Dao

BusyIndicator is a progress indicator with determined and indeterminate state.

Fast Access (Floating Toolbox)

A simple Android library to create Debugging menu.

Debot offers features that are useful to debug Android applications. Those features can be added to any activity that has the toolbar menu. Also, developers can easily add their own custom debugging features with simple steps.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes