12

I'm assuming that no phones with OS before marshmallow support the fingerprint API.

My questions are:

(a) Do all/any Samsung phones released with marshmallow support android fingerprint API

(b) Does any Samsung phones whose OS is upgraded to marshmallow support Android fingerprint API?

I've read these:

Fingerprint scanner not detected when using Android 6.0 Fingerprint API on Samsung S5

Samsung galaxy note 4 fingerprint not found

Android FingerPrint API isHardwareDetected returns false for Samsung Note 4

Devices with fingerprint sensor above 6.0 which are not using Android fingerprint SDK

but no definitive answers. Also samsung's website mentions that all samsung devices support Pass SDK but doesn't mention android fingerprint API support

Vikasdeep Singh
  • 20,983
  • 15
  • 78
  • 104
ColonD
  • 954
  • 10
  • 28
  • Yes it supports..I had tried playing with those a couple months back – Akshay Aug 04 '17 at 06:38
  • yes, but which all devices do not support android's API? Different people seem to be having different experiences based on the model in question and the android version on it – ColonD Aug 04 '17 at 06:41
  • I had tried it on s7 marshmallow..which device you want to get it running on? – Akshay Aug 04 '17 at 06:42
  • It's for an app I'm publishing. I'd like to know on which devices it doesn't work, because my users will probably have slightly older phones (dont know which all they'll have). so i'd like to ensure maximum compatibility. if the number of phones is significant i'll try to ensure support for both pass SDK and android API – ColonD Aug 04 '17 at 06:46
  • Also It'd be good for troubleshooting if any users report not being able to use the feature, I can know whether its a bug or not – ColonD Aug 04 '17 at 06:46
  • Are you targeting for samsung only...if yes post on http://developer.samsung.com the forum – Akshay Aug 04 '17 at 06:47
  • No. all phones. I might probably use a wrapper around both if there's no answer. I think Nexus too has its own SDK – ColonD Aug 04 '17 at 06:54

3 Answers3

3

From my small investigation a had found the following. Pass API will help with Samsung devices, which had fingerprint api before android 6. It is devices of 2014 year with a fingerprint. The list of devices can be found here. https://en.wikipedia.org/wiki/Samsung_Galaxy The main devices:

  1. Samsung Galaxy s5 (and its modifications mini, plus)
  2. Samsung Galaxy Note 4 (Note 4 edge)

They do not support the standard Google FingerPrint Api even after updating android to 6 version.

2

After understanding more clearly requirement from comment below my answer, here is updated answer

Pass is the SDK responsible for Fingerprint feature for Samsung devices. What you can do, you can check if device is using Pass SDK or not.

Below is code to check it:

    FingerprintManager fingerprintManager = (FingerprintManager) getApplicationContext().getSystemService(Context.FINGERPRINT_SERVICE);
    boolean isFingerprintSupported = fingerprintManager != null && fingerprintManager.isHardwareDetected();

    if (!isFingerprintSupported && SsdkVendorCheck.isSamsungDevice()) { // for samsung devices which doesn't support Native Android Fingerprint API
        Spass spass = new Spass();
        try {
            spass.initialize(context);
            isFingerprintSupported = spass.isFeatureEnabled(Spass.DEVICE_FINGERPRINT);
        } catch (SsdkUnsupportedException | UnsupportedOperationException e) {
            //Error handling here
        }
    } else {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { // for devices which doesn't support Pass SDK

            FingerprintManager fingerprintManager = (FingerprintManager) getApplicationContext().getSystemService(Context.FINGERPRINT_SERVICE);
            if (!fingerprintManager.isHardwareDetected()) {
                // This device is not supporting fingerprint authentication     
            } else if (!fingerprintManager.hasEnrolledFingerprints()) {
                // User hasn't enrolled any fingerprints to authenticate with 
            } else {
                // Everything is ready for fingerprint authentication 
            }
        }
    }

Add below permissions to AndroidManifest.xml.

<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY" />

I hope this will help.

Vikasdeep Singh
  • 20,983
  • 15
  • 78
  • 104
  • Hi, Thanks for the answer, but the question was whether Samsung kept using their own SDK for fingerprints or whether they switched to the native android SDK after M. We wanted to know this case for (a) devices that came with M and (b) devices that were updated to M. We finally decided to ignore all other SDKs and just support devices with the native SDK. Thank you for the answer though – ColonD Jun 27 '18 at 06:22
  • @ColonD thanks for your patience and making requirement more clear. I have updated my answer. Please have a look. I think you will get some pointer from it. – Vikasdeep Singh Jun 27 '18 at 06:38
  • @ColonD did you check my answer? I didn't hear any comment from you after my update. – Vikasdeep Singh Jul 04 '18 at 07:08
  • HI, sorry about that. Your code seems to be covering all the bases regarding checking for both APIs. As I was handling this a long time ago, I decided to support only native API, so I forgot about this. Had upvoted your answer as it should work for all cases involving Samsung phones :) – ColonD Jul 04 '18 at 08:15
  • @ColonD As you have changed your mind i.e. requirement but **my answer will cover all the cases** then please accept my answer so that may help others as well. – Vikasdeep Singh Jul 04 '18 at 08:18
  • @ColonD by the way, my initial answer was just to support Native API but you told that you want to check for Samsung SDK as well so I updated my answer :) – Vikasdeep Singh Jul 04 '18 at 08:20
  • Again, thanks for the answer. Although your answer does show **how** to support both APIs, my question was regarding whether Samsung switched to native API, so that We could decide whether it was worthwhile to support pass along with native. see Evgeniy Mishustin's answer https://stackoverflow.com/a/51168447/8258872 – ColonD Jul 04 '18 at 08:42
  • I already knew **how** to support fingerprint API from the start. The question was whether Samsung used pass over native in their phones ( this was my requirement from the start) – ColonD Jul 04 '18 at 08:44
  • is this answer still valid? i tried adding spass sdk dependencies and android studio did not recognise it. – Siddarth G Nov 17 '20 at 07:28
1

I can definitely tell you from my own experience that several Samsung phones continue to use Spass library even on Android M and over. For example right now I'm testing on Mobile OS: Android 6.0.1 (Galaxy Note 4 Edge). I've wrote some code that prints output to the logs in this way:

   /*
    * This function evaluates which fingerprint helper should be instantiated (if any)
    */
    public static FingerprintHelper initializeFingerprintHelper(Context context){
        if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            FingerprintManager manager = (FingerprintManager) context.getSystemService(Context.FINGERPRINT_SERVICE);

            if (manager != null) {
                logger.info("Android native fingerprint manager exists");
                if (manager.isHardwareDetected()) {
                    logger.info("Android native fingerprint manager detected hardware");
                    if (manager.hasEnrolledFingerprints()) {
                        logger.info("Android native fingerprint manager has enrolled fingerprints");
                    }else{
                        logger.info("Android native fingerprint manager has no enrolled fingerprints");
                    }
                    return new AndroidFingerprintHelper(context);
                }

            }
        }
        try{
            logger.info("Android native fingerprint manager is null, trying Samsung SPASS rollback");

            Spass spass = new Spass();
            spass.initialize(context);
            if(spass.isFeatureEnabled(Spass.DEVICE_FINGERPRINT)){
                return new SamsungFingerprintHelper(context);
            }
        } catch (SsdkUnsupportedException e) {
            logger.error("Spass library is missing on the device");
        }
        return null;
    }

And from the logs in the console I see that although Android Version on the devices is M(6.0.1) - the method

manager.isHardwareDetected()

returns false and the method goes to Spass lib initialization and it suceeds. So the device definitely using Spass library on android M.

Vikasdeep Singh
  • 20,983
  • 15
  • 78
  • 104
Evgeniy Mishustin
  • 3,343
  • 3
  • 42
  • 81