我在我的 Android 手机上存储了两个指纹。我想在 Android Studio 中编写一个应用程序,它有两个选项;如果我将第一根手指放在扫描仪上,第一个选项会成功,第二个选项会在我将第二根手指放在扫描仪上时成功。安卓可以吗
我的代码适用于单个指纹;当我放任一个手指时,它会起作用,因为两个手指都已注册。
最佳答案
虽然指纹识别软件知道匹配的是什么模板,但如果我没记错的话,这不会传播到更高层并暴露在BiometricPrompt API中。 .
在 API 被谷歌标准化之前,这个功能在 Android 手机的第一个实现中可用,但我只是注意到这一点:
在 AuthenticationResult
上有两个有趣的函数 getId()
和 getUserId
也许它们可以为您提供相关的东西。
/**
* Obtain the biometric identifier associated with this operation. Applications are strongly
* discouraged from associating specific identifiers with specific applications or
* operations.
* @hide
*/
public BiometricIdentifier getId() {
return mIdentifier;
}
/**
* Obtain the userId for which this biometric was authenticated.
* @hide
*/
public int getUserId() {
return mUserId;
}
关于android - 我们可以在Android中编写代码以使用多个指纹打开不同的应用程序吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58638983/