-->

Use new fingerprint API from Android for multiple

2019-01-20 00:57发布

问题:

We are creating a timestamp application on Android and ideally this would use fingerprint to identify the user.

In one organisation there can be like 150 different users. Would the fingerprint API allow multiple users? Or is this currently only for the owner of the device? If this is only for the current users, are there any other API's available that would allow this? If not I think we need to abandon this road completely.

回答1:

Android M or Samsung or iPhone APIs only allow to verify current user against user of device.

There's some fingerprint scanners compatible with Android Platform and with SDK for Android. These SDKs allow to get fingerprint image or template. Scanners are plugged on USB port so you can't charge tablet and use fingerprint scanner simultaneous. For instance:

  • http://www.dermalog.com/en/products_solutions/fingerprintscanner/
  • http://www.futronic-tech.com/product_fs80h.html
  • http://www.crossmatch.com/authentication-hardware/

There's also some devices with integrated fingerprint scanner and with SDK to get fingerprint image or template.



回答2:

you can use android.hardware.fingerprint.Fingerprint.class

/**
* Container for fingerprint metadata.
* @hide
*/
public final class Fingerprint implements Parcelable {
    private CharSequence mName;
    private int mGroupId;
    private int mFingerId;
    private long mDeviceId; // physical device this is associated with
 ...
}

to compare against with enrolled one together with FingerprintManager inner class but visibility of api is hidden and you need use reflections

 /**
 * Container for callback data from {@link FingerprintManager#authenticate(CryptoObject,
 *     CancellationSignal, int, AuthenticationCallback, Handler)}.
 */
public static class AuthenticationResult {
    private Fingerprint mFingerprint;
...
}