简体   繁体   English

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

[英]Register user fingerprint in an android application

I want to make an android application, which registers user fingerprint (from device's fingerprint scanner) and stores it in a data structure or in key store provider, next time user put his fingerprint scanner, he should be authenticated from the fingerprints stored in the data structure or from the android keystore provider.我想制作一个 android 应用程序,它注册用户指纹(来自设备的指纹扫描仪)并将其存储在数据结构或密钥存储提供程序中,下次用户放置指纹扫描仪时,他应该通过存储在数据中的指纹进行身份验证结构或来自 android 密钥库提供程序。 If anyone can help me how to approach for this.如果有人可以帮助我如何解决这个问题。 Thanks in advance.提前致谢。

Sorry but as far as I know, no way to register fingerprint.抱歉,据我所知,无法注册指纹。 User should register his/her finger in settings.用户应在设置中注册他/她的手指。 You can just check user fingerprint for Authentication.您可以只检查用户指纹进行身份验证。 If there is no registered finger or has no fingerprint sensor, easily toast it.如果没有注册手指或没有指纹传感器,请轻松敬酒。

//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();
        }

Check this tutorials to understand how check user fingerprint:查看本教程以了解如何检查用户指纹:

Link1 Link2 链接1 链路2

无法注册指纹,无法访问指纹数据,因为存储在android安全的地方

You can retrieve Fingerprint Ids from android after registration.注册后,您可以从 android 检索指纹 ID。

So you can utilize settings activity from android to register and match the fingerprint IDs from there With individuals, That way, you can use that for identification and verification.因此,您可以利用来自 android 的设置活动来注册和匹配来自个人的指纹 ID,这样,您就可以将其用于识别和验证。

Regards.问候。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM