If fingerprint scanner is available let user use my apps feature by authenticating with fingerprint.
Asked
Active
Viewed 1.1k times
2 Answers
18
Try this code:
FingerprintManager fingerprintManager = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
if (!fingerprintManager.isHardwareDetected()) {
// Device doesn't support fingerprint authentication
} else if (!fingerprintManager.hasEnrolledFingerprints()) {
// User hasn't enrolled any fingerprints to authenticate with
} else {
// Everything is ready for fingerprint authentication
}

Yev Kanivets
- 1,780
- 3
- 22
- 38
-
2It is deprecated now. You should use BiometricPrompt – Leo DroidCoder Jan 20 '20 at 20:44
0
Try hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)
on a PackageManager
instance (you can get one from calling getPackageManager()
on any handy Context
).

Aiuspaktyn
- 970
- 1
- 13
- 16
-
6looks like a copy of @CommonsWare response, http://stackoverflow.com/a/35302139/869451 – efeyc Oct 24 '16 at 09:29