For above version SDK 23 using permissions I am able to fetch result from fingerprint using external biometric device.
//Get an instance of KeyguardManager and FingerprintManager//
keyguardManager =
(KeyguardManager) getSystemService(KEYGUARD_SERVICE);
fingerprintManager =
(FingerprintManager) getSystemService(FINGERPRINT_SERVICE);
textView = (TextView) findViewById(R.id.textview);
if (!fingerprintManager.isHardwareDetected()) {
textView.setText("Your device doesn't support fingerprint authentication");
}
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) {
textView.setText("Please enable the fingerprint permission");
}
if (!fingerprintManager.hasEnrolledFingerprints()) {
textView.setText("No fingerprint configured. Please register at least one fingerprint in your device's Settings");
}
if (!keyguardManager.isKeyguardSecure()) {
textView.setText("Please enable lockscreen security in your device's Settings");
} else {
try {
generateKey();
} catch (FingerprintException e) {
e.printStackTrace();
}
}
But I am stuck to get fingerprint result from below version of SDK 23.
Please provide some ideas if someone handle fingerprint authentication in below version of SDK 23 by using external bio-metric device.