Good day!
And how do you determine the location of the user?
After long torment in finding ways to determine the location for "one-time" use, I decided to contact you, dear experts! The fact is that I support the project for a long time, and there were about three ways to determine the location.
The first method was about the same as in this example with the brute force of providers, but there were devices on which it did not work, or worked through time.
The second method was a modification of the first one, but using the background flow, which informed about this when finding the location, the method turned out to be better than the first one in all directions, but looked for a better position, i.e. It worked so where it did not work. But again, there were devices where this was not enough
- Here is the third way it seemed to be one hundred percent, since it was based on Google maps, which, it seems, should determine the location whenever possible. An instance of MapView was created that never showed up, MyLocationOverlay was created to show the user, and he informed us about the current location. But today I ran into a device where it didn’t work, but because I used the empty string as a key when creating the MapView. But now it’s impossible to create a key for old versions of maps.
Of course, you can go back to sleep and use new maps instead of old ones, but there are users who cannot use new maps, and one of the main features of the application is tied to the location.
So, what method of positioning do you use and how do you struggle with the problem, that there are devices where it does not work? I would be glad to see as answers examples how it works for you.
UPD: I am familiar with this article , but having collected an example and starting at myself was surprised how much gluttonous this battery was, it made a modification, but nothing helped
UPD_2: by location uncertainty, I mean either the absence of one, or its incorrect finding, because sometimes results came 5 minutes ago, and taking into account the movement it plays its role
UPD_3: Due to the large number of views of the issue, I decided to write a solution to the problem: how I found the solution - described in the article