Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BiometricManager on Android 9

Android 9/Android P (API 28) is said to support facial recognition via BiometricPrompt. All of the tutorials that I've read use BiometricManager for detecting Facial recognition support - but this class wasn't added until API 29 (Android 10/Android Q).

So, how can I detect facial recognition support on API 28?

My preference is to do this without using the AndroidX support library, as I've read conflicting information about what the support library's version of BiometricManager.canAuthenticate() results mean when run on API 28 and lower.

like image 372
steve hannah Avatar asked May 23 '26 02:05

steve hannah


1 Answers

Answering my own question. It appears that even on Android 10 there is no way to find out if the device supports facial recognition, since BiometricManager.canAuthenticate() will return success if the device supports fingerprint auth. From API Docs:

This is the equivalent of canAuthenticate(int) with Authenticators#BIOMETRIC_WEAK

And BiometricManager.canAuthenticate(int) isn't available until API 30.

So using BiometricManager on Android 10 is no different than using the deprecated FingerprintManager.

So working back to my question about BiometricManager support on Android 9. There is no difference between using FingerprintManager and BiometricManager when it is running on an Android 9 device. Therefore the equivalent of BiometricManager is FingerprintManager.

But this doesn't help someone like me that is looking for a way to determine if the device supports facial recognition. There doesn't seem to be any way to determine this pre Android 11.

like image 146
steve hannah Avatar answered May 26 '26 11:05

steve hannah



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!