Hi All,

i am creating a Gps apps in android phonegap-1.5.0.

i have added coredova-1.5.0 jar & coredova-1.5.0.js.
when i send mock data from the DDMS panel , sometimes it says "not
able to send data to emulator"
& sometimes nothing happens.

Here is my code:



<!DOCTYPE html>
<html>
<head>
  <script type="text/javascript" charset="utf-8" src="coredova-1.5.0.js">
function watchLocation(successCallback, errorCallback) {
  successCallback = successCallback || function(){};
  errorCallback = errorCallback || function(){};

  var geolocation = navigator.geolocation;

  if (geolocation) {
        
    try {
      function handleSuccess(position) {
        successCallback(position.coords);
      }


      geolocation.watchPosition(handleSuccess, errorCallback, {
        enableHighAccuracy: true,
        maximumAge: 5000 // 5 sec.
      });
    } catch (err) {
      errorCallback();
    }
  } else {
    errorCallback();
  }
}


function init() {
  watchLocation(function(coords) {
    document.getElementById('test').innerHTML = 'coords: ' +
coords.latitude + ',' + coords.longitude;
  }, function() {
    document.getElementById('test').innerHTML = 'error';
  });
}
  </script>
</head>

<body onload="init();">
  <div id="test">Loading...</div>
</body>
</html>


if anybody have any suggestion , idea  please share.

thanks in advance.

With  Regards,
Subrat

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to