Android的网络位置需要时间来更新位置 [英] Android network location takes hours to update location

查看:104
本文介绍了Android的网络位置需要时间来更新位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Andr​​oid应用程序我用的是网络提供商以接收位置监听器位置更新,并将其同步到我的服务器。在测试时,我就带了设备和驱动几个小时的路程和COM回来的第二天。

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.

现在的问题是听者有时需要几个小时给我一个更新的位置。我会离开A点到B点,这需要3个小时的设备报告B作为新的位置。同样的情况,第二天从B点要回到A。

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.

这似乎很奇怪,它在说话这么长时间才更新的位置。距离过滤器600米和10分钟计时间隔。为三小时左右的最好,我可以使用网络供应商期待?

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?

在一个侧面说明,这一切能够完美使用GPS。

On a side note, it all works perfectly using gps.

推荐答案

我不知道你的code正在做(这将是看你的code有用),但这种尝试得到一个快速的当你第一次启动位置更新位置更新:

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:

Location networkLocation = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);

的距离过滤器和时间间隔设置的建议,没有说明,所以它可能是它忽略了这些建议。

The distance filter and the time interval settings are suggestions, not instructions, so it's possible that it's ignoring these suggestions.

这篇关于Android的网络位置需要时间来更新位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆