I\'ve tried to setup Phonegap on Android and deviceready won\'t fire. The reason is that DeviceInfo.uuid is always null/undefined.
It seems
If you want some function to execute when the device is ready do something like this
document.addEventListener("deviceready", onDeviceReady, true);
// PhoneGap is now ready
function onDeviceReady() {
// Write your code here
}
I am not sure why your code is not working.Try placing the document.addEventListener outside the scope of the function.