Reputation: 585
I am working on an application with a requirement to track the current location, rather precisely over a long period of time.
I decided to use the Fused Location Provider API for that purpose since it is designed for battery saving and efficiency.
Over some time of testing now I have ended up with a couple deal- breaking issues in the fused location provider api or even deeper down the software stack in the NETWORK_PROVIDER
( which I believe is being used by the fused location provider ).
I have tried all types of LocationRequest priorities and a lot of various parameters for them. The non-stationary WIFI issue remains in all scenarios and affects all apps on the device including google's own.
What came to mind first was to just try to ignore location locks coming in through WIFI triangulation but since there no way of knowing where the location comes from using the Fused location api, that idea was a deadend.
Filtering out those locations is also really tricky since well, the device often stays at wrong locations for hours/days and moves there.
I have found that there are already quite some google bug tracker issues that have been opened mentioning at least issue 1. (https://issuetracker.google.com/issues/37123060 for example) None of the issues has ever been addressed.
I am thinking of ditching the Fused Location provider for good since everything I try is a deadend. That leads me to ask the following questions:
Thanks for any help.
EDIT: The issue is now being discussed as well at https://issuetracker.google.com/issues/37058437
**EDIT (August 8 2017) Added another strange finding in location callbacks
Upvotes: 2
Views: 764
Reputation: 21
I think it is understood that there are trade-offs between accuracy and battery consumption. But this smells more like a bug. Here is an example why I say that: my phone knew perfectly well that I was no longer in Honolulu when I reconnected to my home WiFi, because I had used it extensively over the return trip in Dallas, Boston and other places, including using Google Maps to get me to intermediate places. Yet, somehow the Google data base ended up with the bogus location Honolulu for my home WiFi so that when someone else connected to my home WiFi they started sporadically getting weather updates for Honolulu! Now if my phone had been in Airplane Mode all the way, this would make slightly more sense. But even then, the overwhelming evidence is that my home WiFi is where it is, a single phone momentarily reporting a wrong location should not be able to change that.
Upvotes: 0
Reputation: 93559
First off, you need to stop thinking of location as a single coordinate. Nothing will get you that. Location is a probability field. Even using GPS, the location it gives you comes with an accuracy in meters. There's a 67% chance that the user is within that many meters of the location it gives you. Which means there's a 1/3 chance they aren't. Sometimes the difference is great- if you run gps all night, you'll get a couple of fixes that are hundreds of meters off. You just have to deal with this.
Secondly- Fused is a compromise. Its lower battery than GPS, but lower accuracy. Its good enough for most purposes. It may or may not be good enough for yours. The real questions are do you really need to be hyper accurate, and does being so add value to your users? Is the occasional bug in location worth draining their phone? This answer changes based on how frequently you need location data- if you need it all the time, the answer is more likely to be that battery is a bad idea.
Any method of location tracking has issues. You just need to decide which are the least painful to use. Here's a partial list:
GPS- high accuracy, high battery use, high startup time, doesn't work indoors, accuracy can be reduced by the government
Beacons- extremely high accuracy, requires bluetooth, only works in a specific area, requires external hardware, possible to spoof by 3rd party (setting his beacon ids to yours)
Network based- low accuracy, low resources required, possible to spoof by 3rd party if in isolated area (setting fake wifi network SSIDs)
Fused- uses a combo of gps and netork data. SO you have a mix of the problems of each.
Upvotes: 0