问题
Is it possible to retrieve the number of available fingerprints in an Android device.
I want to do some functionality when number of fingerprints changes in the device.
For that I have to retrieve the number of fingerprints in the device first.
Can anyone suggest how to do that.
回答1:
On devices with a fingerprint sensor, users can enroll one or more fingerprints and use those fingerprints to unlock the device and perform other tasks. Android uses the Fingerprint Hardware Abstraction Layer (HAL) to connect to a vendor-specific library and fingerprint hardware, e.g. a fingerprint sensor. There is a method enumerate
(Synchronous call for enumerating all known fingerprint templates)
There is also Android's FingerprintManager. But it has a method hasEnrolledFingerprints
which returns true if there is more than one fingerprint enrolled.So you won't know how many or if there was any added.
Useful links to the docs HAL
FingerprintManager
来源:https://stackoverflow.com/questions/47193924/is-there-a-way-we-can-find-the-number-of-available-fingerprints-in-device