I'm writing a PhoneGap application that sends requests to a central database. It needs to be able to identify the unique devices that connect to it.
PhoneGap's device.uuid
property would seem to do the trick. On webOS and iPhone, I get back a unique string of alphanumeric characters, which will satisfy my need. However, the Android devices I've tested (Motorola Droid and the Android SDK emulator, both running Android 2.1) return "undefined" as the device.uuid
.
device.platform
and device.name
return correct values on all three platforms, so the problem doesn't have to do with the device
object itself (it's defined in the code blocks where I use it).
Is this an Android limitation? A problem with PhoneGap?
Is there any other way to get such a globally unique identifier if not through device.uuid
?
EDIT: It appears that the deviceready
event is never getting fired, which needs to happen before the device.uuid
property becomes available.