Given wireless is turned on 24/7 for most people, it seems to me that a better method would be to cache APs that the user sees, so that if the same set of APs (or a significant subset there-of) are visible there is no need to ask for the GPS parts to be turned on. Obviously that is more work and there are some complexities to account for¹²³ but this is how Google's timeline uses little power. They have an centralised international database of AP locations (slurped while collecting images for Maps/Streetview and no doubt other sources) but that isn't really needed – you can just keep a list of APs seen recently and where on each users own device⁴.
It isn't something I'd have time or desire to develop. You'd have the faf of getting it approved in an appstore, dealing with supporting users that just don't understand, fun with some phones⁵ overly aggressively killing apps not matter what the user selects in order to make grandiose battery life claims (and users blaming that on your app), etc., but if someone else wants to (especially if it is an open source and/or stalking free app) feel free to take the idea, and I'll consider using your implementation!
---
[1] APs move or get renamed
[2] Assuming APs are identified by SSID there will be some names that are the same in multiple locations
[3] Some APs constantly move by design, i.e. those on public transport.
[4] Not having a central DB just means each device doesn't immediately benefit from the location cache avoiding GPS use when visiting a new area, but each device will quickly build a view of local APs for any area it enters.
[5] I'm looking at you, Xiaomi!
I have been thinking about how to replace Timeline for a while; the problem with most solutions is they don't do the snapping to semantic locations that Timeline does for you. And even if they did, an open source solution would probably have to snap to OSM POIs, which tend to be lower quality.
How does Google timeline achieve higher resolution with lower power consumption? Does it rely on special APIs or databases that other apps don't have access to?
> Does it rely on special APIs
No APIs that I know of. Just having the relevant permissions out-of-the-box, and perhaps (caveat: guessing here) having an exclusion from being blocked by aggressive power management tools (Xiaomi devices are notorious for breaking background apps in the name of battery conservation, and it works well enough on mine despite it occasionally killing the podcast app I'm actively listening to, despite all the relevant “don't kill this” options/permissions being set).
> or databases that other apps don't have access to?
They have a database of AP locations which their own services use: https://support.google.com/maps/answer/1725632?hl=en-GB
Thinking about it, if the standard location APIs give access to this information with the same granularity, then a tracking app wouldn't need to be especially bright itself.