问题
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