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

4

2 回答 2

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.

于 2013-01-05T16:00:20.923 回答
0

GPS 技术不测量速度。这只是一种获得准确位置的方法。速度值基于位置计算。
这就是为什么您无法获得更好的速度值频率:信息不存在。只有在位置更新之后(非常短的时间)才能有任何速度更新。

于 2013-03-17T01:05:06.707 回答