可以使用Android检查指纹扫描仪

时间:2016-02-16 09:56:33

标签: android

如果指纹扫描仪可用,则允许用户通过使用指纹进行身份验证来使用我的应用功能。

2 个答案:

答案 0 :(得分:17)

试试这段代码:

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 
}

答案 1 :(得分:0)

PackageManager个实例上的

Try hasSystemFeature(PackageManager.FEATURE_FINGERPRINT)(您可以通过任意方便getPackageManager()致电Context获得一个。)