0

In my android application i need to GetSpeed from GPS But the onLocationChanged() is called only every second even if set distance distance/time to 0 in requestLocationUpdates

How can i get the GPS Speed with higher frequency ? I don't need position, only speed

Is it possible to call GetSpeed outside onLocationChanged()?

Thank You very much

2 Answers2

1

onLocationChanged is slow because it takes some time to fire get a first gps fix from the hardware. The speed estimate is a property of gps fixes. Hence speed changes along with with the location. You can try getLastKnownLocation() wich provides the last fix immediately. Use location.getTime() to decide if the last location is fresh enough.

orange
  • 31
  • 1
  • if i call getLastKnownLocation() every 100ms the speed and time are updated only 1000ms. Is there a other way to get the speed from GPS? I tested o 2 devices and times are the same – user1951039 Jan 06 '13 at 14:39
0

GPS technology does not measure speed. It is merely a way to get accurate position. The speed value is based on position calculation.
That's why you can't get better frequency for speed values: the information is not there. Only (very short time) after a location update can there be any speed update.

Oren S
  • 1,820
  • 1
  • 19
  • 33