Saturday, March 28, 2015

PIN Screen Library for Android

Here's a simple and easy implementation for adding PIN lock support for your Android apps. The library can be themed with your app theme colors. It has smooth animations and vibrate cues when something's wrong.


To use this, you just have to write about 10 lines of code, including layouts and everything. It's so simple.

Steps to implement
  • Add as dependency
      Maven:
<dependency>
    <groupId>com.kbeanie</groupId>
    <artifactId>pinscreenlibrary</artifactId>
    <version>1.0.0</version>
</dependency>
       Android Studio:
compile 'com.kbeanie:pinscreenlibrary:1.0.0@aar' 
  • Add PinView to your layout file. 
<com.kbeanie.pinscreenlibrary.views.PinView
    android:id="@+id/pinView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />
  • Initialize PinView in two modes 
pinView.setModeSetup(PinEntrySetupListener);
pinView.setModeAuthenticate(PinEntryAuthenticationListener)

And finally, handle the callbacks for all events. The complete source code for this project can be found on Github. Let me know if you have any queries or issues. I would be happy to resolve them. 

No comments:

Post a Comment