I’d like to (loosely) tie a file to a particular device, looking for some identifiers that are static per device:
http://developer.android.com/reference/android/os/Build.html#DEVICE
I’m hoping that:
Build.DEVICE
is constant? For example, no system upgrades or hardware changes would modify that value?
Thanks
Build.DEVICEis likely to stay unchanged, as @zrgiu said. However, it’s not unique per device, so two devices that are the same will have the same value for it.If you are looking for a device-specific value,
Build.SERIALis better option. Or at least it would’ve been, if it was guaranteed to exist for all devices.Another alternative is
Settings.Secure.ANDROID_ID, which is guaranteed to exist on each device. Sadly, that one is not guaranteed to be unique across devices (even though the algorithm to generate it will make reasonable attempt at it). This one also will not be persisted across factory reset, if that is important to you.There is no value that is guaranteed to be there, to be unique per device, and to be persisted across factory reset. You can pick any two out of these three… 🙂