Devices with fingerprint sensor above 6.0 which are not using Android fingerprint SDK

亡梦爱人 提交于 2019-12-08 03:13:16

问题


I have implemented fingerprint authentication (of course with official Android fingerprint SDK!) in my app recently, some of my users have complained that they have fingerprint sensor (with Android 6.0) in their phone but unable to use the feature.

I have done some investigation on that, and I found that Samsung S5 and Note 4 devices have fingerprint sensor with 6.0 but they are not using the official Android fingerprint SDK.

My questions:

  1. Is anyone have the list of devices which uses their own fingerprint SDK.
  2. In this case, I would like to convey the user that your device is not supported by the app. Is there any reliable way I can programmatically find these devices("Devices with unsupported fingerprint sensor with 6.0 & above") and show the message?

回答1:


You can check it with the FingerprintManager like

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
    FingerprintManager fingerprintManager = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);
    if (!fingerprintManager.isHardwareDetected()) { 
        // Device doesn't support fingerprint api. Notify the user.
    }
}

and as usual, you'll need the permission

<uses-permission android:name="android.permission.USE_FINGERPRINT" />


来源:https://stackoverflow.com/questions/40681574/devices-with-fingerprint-sensor-above-6-0-which-are-not-using-android-fingerprin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!