I have an Android application with a widget that uses the fused location provider API to keep track of the user's location. The widget works fine on most of the cases but sometimes, users report that the widget reports a wrong location, many miles away.
I have confirmed that this problem is caused by bad network connections (either wifi or cell) because if users connect from another location or using a different method (wifi to cell for example), the location is detected correctly.
In all cases though, users report that Google Maps show the correct location, even when my application displays the wrong one. Is there a way to prevent the wrong location from being displayed, for example filter out erroneous locations? How does Google do it?
The code I am using is from here https://developer.android.com/training/location/receive-location-updates.html.
Thanks