4 ms·
I am running Android 7.1.2. I remember in the older versions of android, when you turned off the GPS, it would have to manually sync the receiver and it would t
by kop316 9y ago
I am running Android 7.1.2. I remember in the older versions of android, when you turned off the GPS, it would have to manually sync the receiver and it would take minutes to get GPS lock. In the current version, when I turned off location services, there is no "dot" indicating your location on Google Maps, but it appears almost instantly when you turn it off. I have long suspected that Android has the "coarse location" and "GPS location" always tracking, but merely just does not give Apps the data until location services is turned on.
- mikeash 9y agoThere are other strategies for getting a lock faster. Most of the slowness for a cold start with a modern receiver is receiving the ephemeris data (i.e. where the satellites are at the moment), which is transmitted at a whopping 50 bits per second, and so takes about 30 seconds to receive. Once you have that, the rest comes quickly. Older receivers with less computational power and less clever techniques could take a long time to work out your position after that, but modern ones can do it pretty much right away as long as the signal strength isn't crap. That ephemeris data is good for 2-4 hours, so one simple technique to improve lock times is to save it, and then if you turn the receiver back on within that window, you can reacquire a lock almost instantly using the saved ephemeris data. Another technique is to download the ephemeris data from a source that can provide it more quickly, such as the cell network. This skips that long transmission at 50bps from the satellites themselves. Pretty much any GPS chip in a cell phone these days will do this. This is called assisted GPS, or A-GPS. (This is not to be confused with another technique also called A-GPS, where the GPS chip captures the signal and sends it to the cell tower to offload the computation. This was a popular approach in older phones to comply with 911 reporting requirements, but doing the computations onboard is cheap now.) Starting with a coarse guess of your location can also help shorten the time to initial lock, although it should be fairly short regardless. That guess can come from looking at cell signals along with known cell tower locations, and a rough altitude estimate can be made from the device's barometer. All of which is to say, getting a dot almost instantly when you turn on location services doesn't necessarily mean too much here.
- kop316 9y agoInteresting, thanks for the info! I knew you could do some tricks to get a lock faster with GPS, but I am not sure of all of them.
- throwaway613834 9y agoThere's a way to test that hypothesis. Install a different version of Android on the same phone and see if the behavior still changes. If not, it's a hardware thing. If it does, then dig into the source code to see if anything explains the change...
- amartya916 9y agoThank you (& kop316 for the parent comment) for taking the time to jot this down. It made for a fascinating read for someone like me who is ignorant about how these networks/connections work. Given Android's popularity/prevalence, do you think that for "coarse" location awareness, using Wi-FI Direct + Bluetooth for a local mesh with other Android devices is a possibility (basically, if one of the devices in the mesh has location data enabled, the rest have coarse location data)?
- mikeash 9y agoTechnologically I don't see why that couldn't be done. Transmit known coordinates, do a rough estimate of your distance using signal strength, and add that to the position error. If you get lat/lon from another device and it looks like that device is 300ft away, then your position is lat/lon ± 300ft. It could be tricky to do securely. How do you prevent a malicious device from spoofing bad location data? Android and iOS do something sort of like this already, determining position by looking WiFi base stations with known locations and attempting to do some triangulation. This can speed up a fix if the GPS signal is having trouble, and can be essential for indoor location because GPS signals don't penetrate structures well at all. My understanding is that the database gets built up by the devices. When they have a good location fix, they'll report back on the WiFi base stations they see, so that the mothership can build a database of where the things are. This is a little bit like what you describe, but with a really roundabout data path.
- superobserver 9y agoThis is a fair description. Google would never exempt itself from info gathering. It's their platform, after all.
- 0x00000000 9y agoYou can't even use course location anymore. The battery saving location setting exists but as soon as an app requests high accuracy the global setting reverts to high accuracy