Face authentication to unlock my app programmatically

倾然丶 夕夏残阳落幕 提交于 2019-12-23 01:43:19

问题


I am developing an android app which uses fingerprint/face recognition for unlocking the app.

I have successfully integrated fingerprint authentication using BiometricPrompt. But didn't know where to start for Face authentication. Any headsup will be really helpful.

Also, Since BiometricPrompt comes with face, fingerprint, and iris, I don't want to use either MLKIT or any third party libraries.

Below is the piece of code I used for Fingerprint authentication.

new BiometricPrompt
    .Builder(context)
    .setTitle(title)
    .setSubtitle(subtitle)
    .setDescription(description)
    .setNegativeButton(negativeButtonText, context.getMainExecutor(),
                        new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialogInterface, int i) {
            biometricCallback.onAuthenticationCancelled();
        }
    })
    .build()
    .authenticate(new CancellationSignal(), context.getMainExecutor(),
            new BiometricCallbackV28(biometricCallback));

回答1:


Android 10: Will allow both finger print and Face ID as currently in Samsung s10.

Android 9: Will allow only Fingerprint authentication (irrespective of face Id unlock exist or not )

reference link https://source.android.com/security/biometric/#source



来源:https://stackoverflow.com/questions/53738969/face-authentication-to-unlock-my-app-programmatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!