且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

安卓:requestLocationUpdates最多每45秒更新的位置

更新时间:2022-12-29 22:14:52

您可以设置minTime为任意值。但是,你只会得到一个更新一次新的位置是可用的。该网络只更新每隔45秒左右,我自己的每一个电话。这似乎是网络提供程序的限制。如果你想更频繁的更新使用GPS提供商。根据GPS硬件,你应该避开4Hz的最大更新率。

You can set the minTime to any value. However, you will only get an update once a new location is available. The network only updates every 45 sec or so on every phone I own. This seems to be a limitation of the Network Provider. If you want more frequent updates use the GPS provider. Depending on the GPS hardware you should get a maximum update rate around 4Hz.