Q:

Latitude Longitude tracking in Android Phonegap?

I am new to android  platform so I wanted to start my learning with existing sample code. I am trying to acquire GPS Coordinates so i wote the below code. In the below code once the device is started onDeviceReady() method is firing but onSuccess() method is not firing. How to solve this issue? I am using cordova-2.8.0.jar in my project.  
<!DOCTYPE html>
<html xml:lang="en" lang="en">
    <head>
    <script type="text/javascript" charset="utf-8" src="cordova.js"></script>  
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;">
        <title>PhoneGap</title>
        <script type="text/javascript" charset="utf-8">

    // Wait for Cordova to load
    //
    document.addEventListener("deviceready", onDeviceReady, false);

    var watchID = null;

    // Cordova is ready
    //
    function onDeviceReady() {
        // Throw an error if no update is received every 30 seconds
        alert("Test1");
        var options = {
         timeout: 3000
          };
        alert("TEst2"+options);
        watchID = navigator.geolocation.watchPosition(onSuccess, onError, options);
        alert("TEst3");
    }

    // onSuccess Geolocation
    //
    function onSuccess(position) {
    alert("RAmesh");
       /* var element = document.getElementById('geolocation');
        element.innerHTML = 'Latitude: '  + position.coords.latitude      + '<br />' +
                            'Longitude: ' + position.coords.longitude     + '<br />' +
                            '<hr />'      + element.innerHTML;*/
    }

    // onError Callback receives a PositionError object
    //
    function onError(error) {
      /*  alert('code: '    + error.code    + '\n' +
              'message: ' + error.message + '\n');*/
    }

    </script>
  </head>
  <body>
    <p id="geolocation">Finding geolocation...</p>
  </body>
</html>

A:

Try changing your options as follows:
var options = {
  enableHighAccuracy: true,
  timeout: 30000,
  maximumAge: 0
};

Ensure you have set permission to use location in AndroidManifest.xml:
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

and in your config.xml:
<plugin name="Geolocation" value="org.apache.cordova.GeoBroker" />

