指纹传感器高于6.0的设备未使用Android指纹SDK

编程入门 行业动态 更新时间:2024-10-10 17:28:58
本文介绍了指纹传感器高于6.0的设备未使用Android指纹SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我最近在我的应用中实现了指纹认证(当然使用官方的Android指纹SDK!),我的一些用户抱怨他们的手机中装有指纹传感器(使用Android 6.0),但无法使用该功能。 / p>

我对此进行了一些调查,发现三星S5和Note 4设备具有6.0版指纹传感器,但未使用官方的Android指纹SDK。

我的问题:

  • 是否有人拥有使用其设备的设备列表?自己的指纹SDK。
  • 在这种情况下,我想向用户传达该应用程序不支持您的设备。有什么可靠的方法可以通过编程方式找到这些设备( 具有6.0及以上版本不支持指纹传感器的设备)并显示消息?
  • 解决方案

    您可以使用FingerprintManager进行检查,如

    如果(Build.VERSION.SDK_INT> = Build.VERSION_CODES.M){ FingerprintManager FingerprintManager =(FingerprintManager)context.getSystemService(Context.FINGERPRINT_SERVICE); if(!fingerprintManager.isHardwareDetected()){ //设备不支持指纹API。通知用户。 } }

    和往常一样,您需要获得许可

    <使用权限android:name = android.permission.USE_FINGERPRINT />

    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:

  • Is anyone have the list of devices which uses their own fingerprint SDK.
  • 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?
  • 解决方案

    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" />

    更多推荐

    指纹传感器高于6.0的设备未使用Android指纹SDK

    本文发布于:2023-10-27 04:21:34,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1532296.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:指纹   高于   传感器   设备   Android

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!