Android Fingerprint Authentication Tutorial

Android 6.0 Marshmallow was released the Fingerprint authentication APIs for Android devices. To use the fingerprint touch sensor, the smartphone must have Android 6.0 and above to use this feature. Fingerprint authentication enhances the security of the application and its does not require to enter the password which fast, convenient and reliable. It is suitable for making a transaction and unlocks some sensitive data in the mobile application. In this tutorial, I will tell you how to use Android fingerprint authentication in your project.

Creating a New Project

1. Open Android Studio IDE in your computer.
2. Create a new project and Edit the Application name to “FingerprintExample”.
(Optional) You can edit the company domain or select the suitable location for current project tutorial. Then click next button to proceed.
3. Select Minimum SDK (API 15:Android 4.0.3 (IceCreamSandwich). I choose the API 15 because many android devices currently are support more than API 15. Click Next button.
4. Choose “Empty Activity” and Click Next button
5. Lastly, press finish button.

Add a new permission

Open your AndroidManifest.xml, add fingerprint permission so that you allow to perform fingerprint.

Create a new class

Right click your project name and create a new class “FingerprintHandler”, this class extends the fingerprint manage callback.

Edit activity_main.xml layout

Go to activity_main.xml layout and add one textview, a button in this layout. The textview is to display the status of the fingerprint and button is to perform the fingerprint feature.

Edit class

Open the class and it will generate the key, perform encryption and verify your fingerprint. Follow the source code below.

Run Your Project

In conclusion, now you can run this project in your android device to test the fingerprint authentication.

(Android Fingerprint Authentication)

Source Code

(Visited 403 times, 1 visits today)

Yong Loon Ng

Ng Yong Loon, better known as Kristofer is a software engineer and computer scientist who doubles up as an entrepreneur.

You may also like...

1 Response

  1. Agustin Paz says:

    Hello, this publication is very good.
    How can I do when the fingerprint is validated and that event is taken over by a web service?
    My mane in Agustin from Argentina, Patagonia.

Leave a Reply

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