android指纹解锁

https://blog.csdn.net/createchance/article/details/51991764

指纹解锁的知识点:

1.在manifest文件声明权限

android:name="android.permission.USE_FINGERPRINT"

2.检查运行条件

1)apiLevel23 ;

google推荐使用 Android Support Library v4包来获得FingerprintManagerCompat对象,因为在获得的时候这个包会检查当前系统平台的版本。

2)硬件

fingerprintManager.isHardwareDetected()

3)设备必须处于安全保护中

keyguardManager.isKeyguardSecure()

4)系统中必须有指纹的注册

fingerprintManager.hasEnrolledFingerprints()
3.指纹认证,app需要及时通知用户当前的操作以及操作的结果,比如需要明确告诉用户当前正在扫描指纹,请把你的指纹放在传感器上等。
CryptoObjectHelper cryptoObjectHelper = new CryptoObjectHelper();
fingerprintManager.authenticate(cryptoObjectHelper.buildCryptoObject(), 0,
                            cancellationSignal, myAuthCallback, null);
4.处理扫描结果
MyAuthCallback extends FingerprintManagerCompat.AuthenticationCallback


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值