Android 网络位置需要数小时才能更新位置
在我的 Android 应用程序中,我使用网络提供商在位置侦听器中接收位置更新并将其同步到我的服务器。测试时,我会带着设备开车几个小时,第二天回来。
问题是听众有时需要几个小时才能给我更新的位置。我将离开 A 点并到达 B 点,设备需要 3 小时才能将 B 报告为新位置。第二天从 B 点返回 A 时也会发生同样的情况。
奇怪的是,它花了这么长时间来更新位置。距离过滤器为600m,时间间隔为10分钟。三个小时是我对使用网络提供商的最佳期望吗?
顺便说一句,使用 GPS 一切都可以完美地工作。
In my android app I use the network provider to receive location updates in a location listener and sync them to my server. When testing, I'll take the device and drive a few hours away and com back the next day.
The problem is the listener sometimes takes a few hours to give me an updated location. I'll leave point A and get to point B and it takes 3 hours for the device to report B as the new location. The same happens the next day going from point B back to A.
It seems odd that it's talking so long to update the location. The distance filter is 600m and 10 minute time interval. Is three hours about the best I can expect from using the network provider?
On a side note, it all works perfectly using gps.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道您的代码在做什么(查看您的代码会很有帮助),但尝试此操作可以在您首次开始位置更新时获得快速位置更新:
距离过滤器和时间间隔设置是建议,而不是说明,因此它可能会忽略这些建议。
I don't know what your code is doing (it would be helpful to see your code) but try this to get a quick location update when you first start your location updates:
The distance filter and the time interval settings are suggestions, not instructions, so it's possible that it's ignoring these suggestions.