0

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?

raiym
  • 1,439
  • 1
  • 28
  • 54

2 Answers2

0

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;
    }
tritop
  • 1,655
  • 2
  • 18
  • 30
  • Yeah. I've seen this, but it is not acceptable in my app -_- – raiym Apr 07 '16 at 10:23
  • 2
    And I didn't find Settings.ACTION_FINGERPRINT or something (http://stackoverflow.com/questions/19517417/opening-android-settings-programmatically) – raiym Apr 07 '16 at 10:24
  • 2
    @raiym the closest you can get to that is `ACTION_SECURITY_SETTINGS`. Android won't let you change the fingerprints without leaving your app, the security features are read only. – tritop Apr 07 '16 at 10:33
0

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))
    }

enter image description here

Ronak Mehta
  • 5,971
  • 5
  • 42
  • 69
Qasim
  • 5,181
  • 4
  • 30
  • 51