title: PhoneGap - OnDeviceReady method not getting called
body: <p>I am developing my first application in phonegap (android). </p>
  
  <h1>index.html</h1>
  
  <pre><code> &lt;!DOCTYPE html&gt;
      &lt;html&gt;
        &lt;head&gt;
          &lt;title&gt;Device Properties Example&lt;/title&gt;
  
          &lt;script type="text/javascript" charset="utf-8" src="cordova-1.7.0.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" charset="utf-8"&gt;
          alert('code: 1');
          // Wait for Cordova to load
          //
          document.addEventListener("deviceready", onDeviceReady, false);
          alert('code: 2');
          var watchID = null;
          alert('code: 3');
          // Cordova is ready
          //
          function onDeviceReady() {
              // Update every 3 seconds
              alert('code: 4');
              var options = { frequency: 3000 };
              watchID = navigator.geolocation.watchPosition(onSuccess, onError, options);
          }
  
          // onSuccess Geolocation
          //
          function onSuccess(position) {
              alert('code: 5');
              var element = document.getElementById('geolocation');
              element.innerHTML = 'Latitude: '  + position.coords.latitude      + '&lt;br /&gt;' +
                                  'Longitude: ' + position.coords.longitude     + '&lt;br /&gt;' +
                                  '&lt;hr /&gt;'      + element.innerHTML;
          }
  
          // clear the watch that was started earlier
          // 
          function clearWatch() {
              alert('code: 6');
              if (watchID != null) {
                  navigator.geolocation.clearWatch(watchID);
                  watchID = null;
              }
          }
  
          // onError Callback receives a PositionError object
          //
          function onError(error) {
            alert('code: '    + error.code    + '\n' +
                  'message: ' + error.message + '\n');
          }
  
          &lt;/script&gt;
        &lt;/head&gt;
        &lt;body&gt;
          &lt;p id="geolocation"&gt;Watching geolocation...&lt;/p&gt;
          &lt;button onclick="clearWatch();"&gt;Clear Watch&lt;/button&gt;     
        &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>Here onDeviceReady method is not getting called. Kindly help me understand what i am missing.</p>
  
  <p>I have added these permissions</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
  </code></pre>
  
  <p>in manifest.xml file.</p>