I am working with finger print authentication using android 6.0 api. My requirement is, if current device is supports finger print authentication, then I will go through finger print authentication else will use normal way to login the application.
So, any one can tell me, how to check device compatibility for finger print authentication in android.
Thanks in advance.
You have to use method
isHardwareDetected
onFingerprintManager
class.Don't forget to add permission to access fingerprint functions in AndroidManifest. Since API 28:
Before API28:
With Support Library
If you don't want to check Build.VERSION, it's also possible to check on device lower than Android 6.0 with Support Library
Add dependency:
And use
FingerprintManagerCompat
class as this:This method Works for all Android versions and also check for permission
check this sample example from google
Just a follow up to LaurentY's answer. You need a permission to access the finger print scanner. And for that you need to add this to your Manifest.
API 27 and before
API 28 and later