title: Android problem finding out how recent latest GPS fix is
body: <p>My app uses LocationListener to keep track of the current location. So long as the GPS Provider is providing regular fixes this works well. However, I want my app to alert the user if the location is no longer reliable because the fix is no longer current. I have therefore used a timeCheckHandler to call getLastKnownLocation every few seconds.</p>
  
  <p>My problem is that even when accurate fixes are being received frequently the time returned by applying getTime() to the location returned by getLastKnownLocation is generally older than the current time returned by System.currentTimeMillis(), often by about 20 seconds.</p>
  
  <p>I have investigated the problem further by adding code to onLocationChanged(arg0) to log the time of the fix (arg0.getTime()) and the current time (System.currentTimeMillis()). Again I see a difference of about 20 seconds.</p>
  
  <p>The code currently reads as follows:</p>
  
  <pre><code>    public void onLocationChanged(Location arg0) {
      mapview.handleLocationChanged(mapview, arg0.getLatitude(), arg0.getLongitude(), arg0.getBearing(), arg0.getAccuracy(), "GPS fix");
      addDebugNote("Fix received at time: "+Long.toString(arg0.getTime()/1000)+" Now: "+Long.toString((System.currentTimeMillis())/1000));
  }
  </code></pre>
  
  <p>and typical output to my Debug file reads:</p>
  
  <pre><code>Fix received at time: 1292091908 Now: 1292091928
  </code></pre>
  
  <p>Why should I be seeing this difference between the fix time and the current system time?</p>
  
  <p>Do I have to accept that a difference of around 20 seconds is normal?</p>