views:

402

answers:

1

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.

A: 

I haven't yet found a solution for this, but it is worth noting that this issue is fixed in Android 2.2. But other than that, you'll have to find some other way of getting a unique device identifier if the device is running 2.1 or earlier.

Steve Nay