1

I have a device which has a fingerprint sensor on a home button. Other applications seems to recognise and handle it properly however the application I am building is failing at couple of steps:

I am using android.support.v4.hardware.fingerprint.FingerprintManagerCompat

// at this point isHardwareDetected returns false
val fingerprintManager = FingerprintManagerCompat.from(context)
if (!fingerprintManager.isHardwareDetected) {
    return false
}

If I skip hardware detection step it still fails at

// hasEnrolledFingerprints returns false even tough there 
// are couple of fingerprints registered
if (!fingerprintManager.hasEnrolledFingerprints()) {
    return false
}

The device is UMI Plus E Android 6.0.1

What can be wrong with it?

Additionally here's my manifest regarding fingerprint:

<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-feature android:name="android.hardware.fingerprint" android:required="false" />

Edit

I solved this issue by using reprint library: https://github.com/ajalt/reprint

antanas_sepikas
  • 5,644
  • 4
  • 36
  • 67

3 Answers3

0

This is a simple example of fingerprint authentication in Github, please check and see the result:

Fingerprint Authentication

you can also use this helper method for further usages:

public static boolean isFingerprintDefined(@NonNull Context context) {
    return FingerprintManagerCompat.from(context).isHardwareDetected() && FingerprintManagerCompat.from(context).hasEnrolledFingerprints();
}
Hamed
  • 5,867
  • 4
  • 32
  • 56
  • This doesn't work and the library that the application that you provided uses says that device doesn't support fingerprint – antanas_sepikas Aug 22 '18 at 09:14
  • I know some fingerprint sensors dose not support officially, for instance old Samsung cell phones do it by own API libraries. probably this phone did that so. – Hamed Aug 22 '18 at 14:28
0

Seems more like a hardware issue,

  • Try removing all fingerprints and adding new ones, if you got error while adding new fingerprints like Hardware not ready etc, it means something wrong with the hardware sensor.
  • you can also try dialing *#808# on your device and go to finger print test . And do a finger print auto test, it will give you brief diagnostic report for your hardware sensor.
Qasim
  • 5,181
  • 4
  • 30
  • 51
  • I tried, also I tested on similar device Samsung Galaxy S5 Android 6.0.1 version, which has the same issue. I tested sensor seems to work fine, and other apps seems to be working alright – antanas_sepikas Aug 22 '18 at 12:09
0

I remember long time ago, I faced the same problem. It was the issue with FingerprintManagerCompat class from support library. Try using the FingerprintManager class from platform or update to the latest version of support library.

Ponsuyambu
  • 7,876
  • 5
  • 27
  • 41