Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing Fingerprint authentication for Android [closed]

I am very interested in learning how to develop an android application which uses fingerprint authentication.

How can i implement that Fingerprint authentication?

like image 914
yesh Avatar asked Jan 15 '16 09:01

yesh


3 Answers

Fingerprint Authentication is what you want:

This release offers new APIs to let you authenticate users by using their fingerprint scans on supported devices, Use these APIs in conjunction with the Android Keystore system.

To authenticate users via fingerprint scan, get an instance of the new FingerprintManager class and call the authenticate() method. Your app must be running on a compatible device with a fingerprint sensor. You must implement the user interface for the fingerprint authentication flow on your app, and use the standard Android fingerprint icon in your UI. The Android fingerprint icon (c_fp_40px.png) is included in the Fingerprint Dialog sample. If you are developing multiple apps that use fingerprint authentication, note that each app must authenticate the user’s fingerprint independently.

To use this feature in your app, first add the USE_FINGERPRINT permission in your manifest.

<uses-permission
        android:name="android.permission.USE_FINGERPRINT" />

To see an app implementation of fingerprint authentication, refer to the Fingerprint Dialog sample. For a demonstration of how you can use these authentication APIs in conjunction with other Android APIs, see the video Fingerprint and Payment APIs.

like image 63
ʍѳђઽ૯ท Avatar answered Oct 01 '22 13:10

ʍѳђઽ૯ท


I made a short library for this if you want to take a look at it. Here is how to use it :

<uses-permission android:name="android.permission.USE_FINGERPRINT"/>
...

FingerprintDialog dialog = new FingerprintDialog(Context);
dialog.show(R.string.title, R.string.message, new FingerprintCallback() {
    @Override
    public void onFingerprintSuccess() {}

    @Override
    public void onFingerprintCancel() {}
});

There is the result :

enter image description here

Github link : https://github.com/omaflak/FingerprintDialog

like image 27
Omar Aflak Avatar answered Oct 01 '22 12:10

Omar Aflak


The Xamarin Documentation Says

The FingerprintManager (and its Support Library counterpart, FingerprintManagerCompat) is the primary class for using the fingerprint scanning hardware. This class is an Android SDK wrapper around the system level service that manages interactions with the hardware itself. It is responsible for starting the fingerprint scanner and for responding to feedback from the scanner. This class has a fairly straightforward interface with only three members:

Authenticate – This method will initialize the hardware scanner and start the service in the background, waiting for the user to scan their fingerprint.

EnrolledFingerprints – This property will return true if the user has registered one or more fingerprints with the device.

HardwareDetected – This property is used to determine if the device supports fingerprint scanning. The FingerprintManager.Authenticate method is used by an Android application to start the fingerprint scanner. The following snippet is an example of how to invoke it using the Support Library compatibility APIs:

//context is any Android.Content.Context instance, typically the Activity 
FingerprintManagerCompat fingerprintManager = FingerprintManagerCompat.From(context);
fingerprintManager.Authenticate(FingerprintManager.CryptoObject crypto,
                                int flags,
                                CancellationSignal cancel,
                                FingerprintManagerCompat.AuthenticationCallback callback,
                                Handler handler
                               );

Please See These Developer Resources:
https://developer.android.com/reference/android/hardware/fingerprint/FingerprintManager.html

like image 38
phunsukwangdu Avatar answered Oct 01 '22 14:10

phunsukwangdu