2
votes

I have developed app using codename one.I want to add fingerprint scanner code on snanner event.Is there any scanner event available in codename one for fingerprint scanner?

1
Your question is a bit vague. What are you trying to achieve, maybe I could assist you. - Diamond
I want to add fingerprint scanner functionality to authenticate credential instead of Username and Password .So on which action should I implement this code??? - Shekhar Jadhav

1 Answers

1
votes

Add a button to your form and add an ActionListener event to the button then call the FingerPrintScanner in the event.

private String username = "";
myForm.addShowListener(evt -> {
   Fingerprint.scanFingerprint("Use your finger print to login.", value -> {
        username = storedUsername;
        //Fingerprint is recognized, allow access here
    }, (sender, err, errorCode, errorMessage) -> {
        //Fingerprint is NOT recognized, prevent access or show an error message
    });
});

You should have a logic in place that stores the username when they manually login for the first time and pull the record when the Fingerprint is used.