0

I'm using the following method to create unique identifiers on Android: https://gist.github.com/shareme/2759664

This works fine, but when deleting the app, a new identifier is created which is undesirable.

How can I persist this unique identifier across uninstall / reinstall but still have one UUID per device a user has.

I've researched multiple things already, but didn't find a clean solution yet.

Bonus question: Is this UUID-method really globally unique? Is it absolutely collision-safe?

keyboard
  • 2,137
  • 1
  • 20
  • 32
  • 1
    Possible duplicate of [Is there a unique Android device ID?](http://stackoverflow.com/questions/2785485/is-there-a-unique-android-device-id) – ozbek Aug 25 '16 at 01:08

1 Answers1

0

As per Android guidelines you should be using the AdvertiserID. Yes, it's truly unique, but user can reset it.
If you absolutely need a uuid that survives uninstalls and cannot be reset, you can use the openUUID library, which survives on almost all devices. It basically uses the device serial number, which Android advises against.

lionscribe
  • 3,413
  • 1
  • 16
  • 21