I'm tracking GPS locations with LocationManager.requestLocationUpdates()
using LocationManager.GPS_PROVIDER
and registering a LocationListener
.
My Problem:
All tested devices (Sony neo, Sony active, Moto G) produce Location
objects which do not have fractions of a second in their getTime()
:
<trkpt ...><time>2014-05-24T10:24:59.000Z</time></trkpt>
<trkpt ...><time>2014-05-24T10:25:00.000Z</time></trkpt>
<trkpt ...><time>2014-05-24T10:25:01.000Z</time></trkpt>
<trkpt ...><time>2014-05-24T10:25:02.000Z</time></trkpt>
<trkpt ...><time>2014-05-24T10:25:03.000Z</time></trkpt>
As I'm calculating speed, incline and merge with barometic altitude, 1s (1000ms) resolution is way too imprecise. And I do not believe, that the fixes are all exactly at .000
.
My question:
Is is better to take System.currentTimeMillis()
as the timestamp for my track-points, or is the GPS fix generally far behind "real time" and the calculated positions are actually those from the past (several seconds behind)?
Remarks:
- I know speed calculation is not precise and quite complex when using GPS data
- This is not a duplicate of Matching Location.getTime() milliseconds to NMEA sentences