Given that I have little experience with coding in B4A, the best way, in your opinion, is to create a unique code based on the device's hardware specifications, something like a serial number. For example, someone may suggest a time or date or may want to create a code with the help of the Internet. Suggest the safest one that is less likely to be hacked. It would be better if there was a library or class that could help.
@Jim2025 Before you start a thread, I would like to point out that there is a great search function in this forum. It is located at the top right. Type getUniqueId (sometimes it helps to remove spaces to find self-explanatory routines) in the search field, open the first search result, and maybe you find the answer to your question at post 22.