I am trying to implement the FingerPrint API for my application. I am following the Google's Fingerprint Dialog sample for this purpose.
It works fine if compileSdkVersion=23
and minSdkVersion=23
but my application's compileSdkVersion
is 21 and minSdkVersion
is 14. For this purpose, I am using FingerprintManagerCompat
instead of FingerprintManager
which works fine but the issue is with the Key generation.
android.security.keystore.KeyGenParameterSpec;
android.security.keystore.KeyPermanentlyInvalidatedException;
android.security.keystore.KeyProperties;
Keystore package and its classes are not available to generate the key, all the supported algorithms for the key generation available in 18+ API versions, anybody can guide me how to generate the key to support lower versions, please?
Looking at FingerprintManagerCompat javadoc:
A class that coordinates access to the fingerprint hardware.
On platforms before M, this class behaves as there would be no fingerprint hardware available.
Looking at the source code:
final int version = Build.VERSION.SDK_INT;
if (version >= 23) {
// a working implementation
IMPL = new Api23FingerprintManagerCompatImpl();
} else {
// an empty stub
IMPL = new LegacyFingerprintManagerCompatImpl();
}
If your device is below API VERSION 23, the LegacyFingerprintManagerCompatImpl is used, and this is only a STUB. For example:
@Override
public boolean hasEnrolledFingerprints(Context context) {
return false;
}
@Override
public boolean isHardwareDetected(Context context) {
return false;
}
You cannot use such feature in older device. Those API (some from android.security.keystore) are available only on Android M
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With