1. Are you ready for the Galaxy S20? Here is everything we know so far!

Is this an AVD problem?

Discussion in 'Android Apps & Games' started by ANDRN, Feb 12, 2011.

  1. ANDRN

    ANDRN Lurker
    Thread Starter

    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?
     

    Advertisement

  2. gogbuehi

    gogbuehi Lurker

    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.
     
Loading...
Similar Threads - AVD problem
  1. Rob
    Replies:
    0
    Views:
    0
  2. radimtr
    Replies:
    2
    Views:
    0
  3. KevinDP
    Replies:
    0
    Views:
    99
  4. MisterVargas
    Replies:
    3
    Views:
    1,463
  5. James_Watson
    Replies:
    1
    Views:
    278
  6. Brendon Shaw
    Replies:
    10
    Views:
    884
  7. ptrckstl
    Replies:
    1
    Views:
    2,888
  8. Jason Pichie
    Replies:
    0
    Views:
    288
  9. James_Watson
    Replies:
    0
    Views:
    472
  10. giocot
    Replies:
    0
    Views:
    2,836

Share This Page

Loading...