有时熔断位置停止 [英] Fused Location sometimes STOPS

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

问题描述

我一直在研究追踪用户位置的应用程序。为此,我使用了谷歌播放服务位置模块(又名融合位置)。总之一切正常。 b
$ b

但有时候,完全随机的,我不再接收来自谷歌位置服务的位置更新信息!我的意思是,我的应用程序工作正常,但没有位置更新。不仅如此,如果我启动谷歌地图,它无法修复我的位置(即使打开了GPS)。重新安装我的应用程序不能解决问题。
在我手机上的3个出租车应用程序中,其中2个可以查明我的位置。 (很可能他们正在使用旧的LocationManager来获取设备的位置)。

我发现要解决这个问题,我必须重新启动设备。但是这非常令人不安,我不能指望我的用户在位置更新出现问题时重新启动设备。 (尽管这在过去的2个月里只发生过6次)所以:有人知道这个问题,是否有解决方法?我的应用程序崩溃的谷歌播放服务?

解决方案

尝试更改位置模式为仅GPS,然后转回到Hight准确性。这个问题有时出现在室内时,这可以解决它。



请参阅此处如何以编程方式开启/关闭GPS


I've been working on an app that tracks the user's position. For this I have used the google play services location module (a.k.a. fused location). All in all everything works fine.

BUT sometimes, completely random, I no longer receive location updates from the google location services, at all! I mean, my app is working fine, but no location updates. Not only that,if I start up google maps it can't get a fix on my location (even with GPS turned on). Reinstalling my app doesn't fix the issue. Out of the 3 taxi apps that I have on my phone, 2 of them can pinpoint my location. (Most likely they are using the old LocationManager to get the device's location).

I found that to fix this issue I have but to restart my device. But this is very unsettling, I can't expect my users to restart their devices whenever something goes wrong with the location updates. (though this has only happened to me about 6 times in the past 2 months)

So: Does anyone know about this issue and is there a work-around for it? Is my app somehow crashing google play services?

解决方案

Try change location mode to "GPS only" and than turn back to "Hight Accuracy". The problem occurs sometimes when you are indoor and this fix it.

See here how to switch GPS programatically on/off

这篇关于有时熔断位置停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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