Mobile devices typically have a way for the user to identify themself. This can be using a fingerprint sensor, face detection or even with an old-school passcode or password. The UserAuthentication class, now also available for Android, is a great way to do this authentication.
UserAuthentication works similarly to how it is used on iOS. You can drag the control from the Library onto your layout and then implement the AuthenticationSucceeded event.
To request authentication, call the Request() method with a short string asking the reason why you need authentication.
UserAuthentication1.Request("Authorize me, HAL")
Because this is using system-level APIs, you and your app never know the details about the authentication. You will not know the password, passcode or have any specifics about a fingerprint or face. Instead, if the system determines that the authentication was successful, then the AuthenticationSucceeded event is called.
Here’s a quick video of it in action.
Paul learned to program in BASIC at age 13 and has programmed in more languages than he remembers, with Xojo being an obvious favorite. When not working on Xojo, you can find him talking about retrocomputing at Goto 10 and on Mastodon @lefebvre@hachyderm.io.