这个问题已经有了答案:
How to check device compatibility for finger print authentication in android
4个答案
如果指纹扫描仪可用,则允许用户通过指纹验证来使用我的应用程序功能。
最佳答案
请尝试以下代码:
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
}