I want to prompt user to create fingerprint if doesn't exist in Android Marshmallow SDK.
For example in Samsung Pass SDK (http://developer.samsung.com/galaxy#pass) we can do that.
Is there way to implement it with Android SDK?
I want to prompt user to create fingerprint if doesn't exist in Android Marshmallow SDK.
For example in Samsung Pass SDK (http://developer.samsung.com/galaxy#pass) we can do that.
Is there way to implement it with Android SDK?
Take a look at the fingerprint Dialog sample and also the fingerprint API. Judging by the way they are handling it in the sample it looks like the best thing you can do is to tell the user where to go to enable fingerprints:
if (!mFingerprintManager.hasEnrolledFingerprints()) {
purchaseButton.setEnabled(false);
// This happens when no fingerprints are registered.
Toast.makeText(this,
"Go to 'Settings -> Security -> Fingerprint' and register at least one fingerprint",
Toast.LENGTH_LONG).show();
return;
}
For those, who are still looking, starting from Android P (currently in beta), ACTION_FINGERPRINT_ENROLL has been added to enroll fingerprints, thus if you want to redirect user to fingerprint enroll settings directly, you can do the following:
if (!fingerprintManager.hasEnrolledFingerprints()) {
startActivity(new Intent(Settings.ACTION_FINGERPRINT_ENROLL))
}