Fused location API gives highly inaccurate locatio

2019-05-27 07:25发布

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

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

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

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).

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.

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.

1条回答
We Are One
2楼-- · 2019-05-27 07:36

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?).

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.

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.

查看更多
登录 后发表回答