• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Is this an AVD problem?

ANDRN

Lurker
The AVD never displays the alert message (e.g. alert('initialized');). I don't know whether the addEventListener works in my AVD or not.

I tried the following code also but it never worked:

function onLoad()
{
document.addEventListener("deviceready", onDeviceReady, false);
}

// PhoneGap is ready
function onDeviceReady()
{
var element = document.getElementById('deviceProperties');

element.innerHTML = 'Device Name: ' + device.name + '<br />' +
'Device PhoneGap: ' + device.phonegap + '<br />' +
'Device Platform: ' + device.platform + '<br />' +
'Device UUID: ' + device.uuid + '<br />' +
'Device Version: ' + device.version + '<br />';
}

</script>
</head>
<body onload="onLoad()">
<p id="deviceProperties">Loading device properties...</p>
</body>
</html>


All it showed is - Loading device properties...but never showing the Device name etc. Can someone please help?
 
I had this same issue. Found out it was because I copied the HTML example exactly. To resolve it, I had to change my <script> tag to point to my version of the "phonegap.js". In my case, it was to make sure it was referencing "phonegap-1.2.0.js".

I hope this helps any others running into this peculiar issue.
 
Back
Top Bottom