gpt4 book ai didi

java - 在 Android 应用程序中注册用户指纹

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:41:51 30 4
gpt4 key购买 nike

我想制作一个 android 应用程序,它注册用户指纹(来自设备的指纹扫描仪)并将其存储在数据结构或 key 存储提供程序中,下次用户放置他的指纹扫描仪时,他应该从存储的指纹中进行身份验证在数据结构中或来自 android keystore 提供程序。如果有人可以帮助我如何解决这个问题。提前致谢。

最佳答案

抱歉,据我所知,无法注册指纹。用户应在设置中注册他/她的手指。您可以只检查用户指纹以进行身份​​验证。如果没有注册手指或没有指纹传感器,轻松烤。

//Check whether the device has a fingerprint sensor//
if (!mFingerprintManager.isHardwareDetected()) {
// If a fingerprint sensor isn’t available, then inform the user that they’ll be unable to use your app’s fingerprint functionality//
textView.setText("Your device doesn't support fingerprint authentication");
}
//Check whether the user has granted your app the USE_FINGERPRINT permission//
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) {
// If your app doesn't have this permission, then display the following text//
Toast.makeText(EnterPinActivity.this, "Please enable the fingerprint permission", Toast.LENGTH_LONG).show();
}

//Check that the user has registered at least one fingerprint//
if (!mFingerprintManager.hasEnrolledFingerprints()) {
// If the user hasn’t configured any fingerprints, then display the following message//
Toast.makeText(EnterPinActivity.this, "No fingerprint configured. Please register at least one fingerprint in your device's Settings", Toast.LENGTH_LONG).show();
}

//Check that the lockscreen is secured//
if (!mKeyguardManager.isKeyguardSecure()) {
// If the user hasn’t secured their lockscreen with a PIN password or pattern, then display the following text//
Toast.makeText(EnterPinActivity.this, "Please enable lockscreen security in your device's Settings", Toast.LENGTH_LONG).show();
}

查看本教程以了解如何检查用户指纹:

Link1 Link2

关于java - 在 Android 应用程序中注册用户指纹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45278532/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com