融合位置API关闭谷歌地图后,给出了很不准确位置 [英] Fused location API gives highly inaccurate location after closing google maps

查看:427
本文介绍了融合位置API关闭谷歌地图后,给出了很不准确位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的应用程序使用谷歌熔位置API来接收位置更新,每3分钟。
该位置请求设置如下 -

Our application uses Google Fused location API to receive location updates every 3 minutes. The location request settings are as follows –


  • 间隔 - 3分钟

  • 最快的时间间隔 - 1分钟

  • 优先级 - PRIORITY_BALANCED_POWER_ACCURACY

  • Interval – 3min
  • Fastest interval – 1 min
  • Priority - PRIORITY_BALANCED_POWER_ACCURACY

在一个正常运行的情况下,位置更新正确接收和定位精度pretty良好(20-25米)。

In a normal running scenario, the location updates are received properly and the location accuracy is pretty good (around 20-25 m).

在地图应用程序打开时,它接收到的GPS定位,因此,我们的应用程序也开始接收位置更新,它们基本上是从GPS收发器(我知道这是后续的位置更新有速度和高度值以及) 。

When the Maps application is opened, it received GPS location, and therefore our application also starts receiving location updates, which are basically from the GPS transceiver (I know this as the subsequent location updates have a speed and altitude value as well).

在地图应用程序现在已关闭问题处理。我们的应用程序接收位置更新,但位置坐标不改变,收到的每个后续更新具有较高的精度值。该更新可能上升到精确度甚至1000米,并没有准确的定位接收。再次打开地图应用程序将使我们的应用程序再次收到准确和更新的位置。

Problem occurs when the Maps application is now closed. Our application receives location updates, but the location coordinates do not change and every subsequent update received has a higher accuracy value. The updates may go up to even 1000m of accuracy and no accurate location are received. Opening the maps application again will make our application receive accurate and updated locations once again.

此问题,也可以是设备特定的,因为我看到了摩托罗拉Moto G的,而不是我的其他三星或者Karbonn手机这个问题。

This problem can also be device specific as I saw this problem on a Motorola Moto G and not on my other Samsung or Karbonn phones.

推荐答案

在我的经验,优先级设置为 PRIORITY_BALANCED_POWER_ACCURACY 从来没有得到职位从GPS,除非有其它的应用程序是使用它。这是你在​​你的应用程序(在你的情况下,你只能获得GPS定位时,地图是开放的)找到相同的行为,这似乎是一般行为(见<一href=\"http://stackoverflow.com/questions/24090584/does-priority-balanced-power-accuracy-exclude-the-gps-provider\">Does PRIORITY_BALANCED_POWER_ACCURACY排除GPS供应商?)。

In my experience, setting the priority to PRIORITY_BALANCED_POWER_ACCURACY never gets positions from the GPS, unless other app is using it. That's the same behaviour that you are finding in your app (in your case you only get GPS positioning when Maps is open), and that seems to be the general behaviour (see Does PRIORITY_BALANCED_POWER_ACCURACY exclude the GPS provider?).

我还没有找到任何背景官方文件这让我觉得它可能是依赖于设备。在我的测试,每当我需要GPS定位,我需要优先级改为 PRIORITY_HIGH_ACCURACY

I haven't found any official documentation to background this so I think that it may be device-dependant. In my tests, whenever I need GPS positioning I need to change the priority to PRIORITY_HIGH_ACCURACY.

不管怎样,有一个已知的问题( 57707 ),它是在一些导致该位置提供停在 PRIORITY_BALANCED_POWER_ACCURACY 设置时,直到设备重新启动接收位置更新的设备显示。

Anyway, there is a known issue (57707) that is showing in some devices that causes the location provider to stop receiving position updates when set in PRIORITY_BALANCED_POWER_ACCURACY until the device is restarted.

这篇关于融合位置API关闭谷歌地图后,给出了很不准确位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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