grandouassou
grandouassou

Reputation: 2530

How to distinguish between fingerprint and face id on Android?

I don't see anything related to being able to distinguish between different biometric authentications within the android.hardware.biometrics package.

I have found the FingerprintManagerCompat that has the hasEnrolledFingerprints() methods but I was wondering if it was the way to go as it seems from the documentation that we should rely on the android.hardware.biometrics package classes.

Any advice on that? Did I miss something?

Upvotes: 6

Views: 6695

Answers (4)

Nestor Iniguez
Nestor Iniguez

Reputation: 1

This is by far, not a future-proof piece of code, but it might just get you out of the problem you're in. This may be what you need.

How to get list of available biometric sensors in an android device (any tweaks as documentation doesn't state any)

Upvotes: 0

Anubhav
Anubhav

Reputation: 2180

As of now we ideally cannot. Look into this : https://issuetracker.google.com/issues/111315641

Upvotes: 3

John Ruban Singh
John Ruban Singh

Reputation: 1326

Use Android Biomatric Api

use the below method to identify Biomatric available or not

public int canAuthenticate () // api introduced android 29

Upvotes: -2

Nathan K
Nathan K

Reputation: 207

hasEnrolledFingerprints was depreceated in API 28.

It is now suggested to use BiometricPrompt and BiometricManager instead of FingerprintManagerCompat. This class allows for a seamless biometric UI across the device and allows for any kind of Biometric authentication provided by the OEM.

Where you might have called hasEnrolledFingerprints in the past to see if the user has fingerprints set up, the BiometricPrompt will throw an error specific to this.

Upvotes: 0

Related Questions