Bladimir, the name of the Sub 'Generate' confuses me somewhat.
Does this mean that every time that sub executes, it will generate a different AndroidID?
What I do is the following:
1. Every time the app is opened, it reads the AndroidID.
2. The first time it is opened, I code the AndroidID with an algorithm that produces a unique registration code.
3. The user then enters this code and the app saves it in the key value store.
4. Every time the app is opened, I check whether the app is registered by getting the AndroidID, decoding it, and checking it with the saved registration code.
5. I do not worry too much about factory resets, but some other apps on the phone may reset the AndroidID, and then I must register the app again.
Thanks,
PK