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.

6 thoughts on “PIN Screen Library for Android

  1. How do I set this PinView before a particular activity if password is set and remove , if password not set ?

    Please brief me about this , with respect to an activity

    1. private boolean isPinSetup() {
              PINPreferences preferences = new PINPreferences(this);
              return preferences.isPinSetup();
          }
      

      You can check if PIN is setup by using this piece of code. If PIN not set, you can finish the activity.

    2. PINPreferences preferences = new PINPreferences(this);
      boolean isSetup = preferences.isPinSetup();

      You can check if PIN is setup by using this piece of code. If PIN not set, you can finish the activity.

    3. private boolean isPinSetup() {
              PINPreferences preferences = new PINPreferences(this);
              return preferences.isPinSetup();
          }
      

      You can check if PIN is setup by using this piece of code. If PIN not set, you can finish the activity.

  2. Error:(20, 0) Could not find method compile() for arguments [com.kbeanie:pinscreenlibrary:1.0.0@aar] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
    Open File

    1. I haven’t updated the library for some time. Probably these problems are due to different build and gradle tools version. Will try to check it soon.

Leave a Reply

Your email address will not be published. Required fields are marked *