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?
2
votes
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.