device.uuid undefined in PhoneGap on Android?

Posted by Steve Nay on Stack Overflow See other posts from Stack Overflow or by Steve Nay
Published on 2010-05-20T21:19:44Z Indexed on 2010/05/24 16:21 UTC
Read the original article Hit count: 867

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about android

Related posts about phonegap