Hi,

I'm writing an app which is receiving GPS events in an
onLocationChanged(...) method. The time I receive the location change
notification seems markedly different from the time that the Location
instance I receive holds. I wrote this bit of code to diagnose the
problem...

        public void onLocationChanged(Location location) {
                super.onLocationChanged(location);
                long currentTime = System.currentTimeMillis();
                Log.d(TAG, "location time recorded <" + currentTime + ">, <" +
TimeFormatter.formatTimerTime(currentTime) + ">");
                Log.d(TAG, "location time              <" + location.getTime() 
+ ">,
<" + TimeFormatter.formatTimerTime(location.getTime()) + ">");
                ...
        }

...and the output I get from this looks like this...

09-19 20:31:10.222: DEBUG/MyTimerActivity(577): location time recorded
<1284924670219>, <43:31:10.2>
09-19 20:31:10.222: DEBUG/MyTimerActivity(577): location
time              <1284924702000>, <43:31:42.0>

Ignore the hours part of the formatted time, the time formatter isn't
written to format time from 1970 or whatever it is, just time values
from a start time some minutes ago... I just used it here to
illustrate the point.

The problem is that the time value in the Location instance I receive
is nearly 32 seconds after the time at which I actually receive it.
Why is that?

This code is running on a G1 I use for development. The accuracy
reported with this Location instance is 6m.

Any ideas why the time is 'wrong'?

Many thanks,

Mark

-- 
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