How a phone knows where it is
A phone combines several sources and picks the best one available:
| Source | Typical accuracy | Notes |
|---|---|---|
| GPS and other satellite systems | A few meters outdoors | Needs open sky. Slow for the first position. Weak indoors and between tall buildings. |
| Wi-Fi networks nearby | 10–100 m | Fast, works indoors, needs Wi-Fi turned on (not necessarily connected). |
| Mobile network cells | Hundreds of meters to kilometers | Works almost everywhere, very rough. |
| IP address (desktop browsers) | A city, sometimes the wrong one | The IP address is the number your internet provider gives your connection, and it only hints at a region. A VPN (a service that sends your traffic through another place) or a phone used as a hotspot can put you in another city or country. |
Every position comes with an accuracy radius: “you are probably within 35 m of this point”. Apps should use it. A position that’s accurate to ±900 m must not be turned into an exact street and house number. This is location accuracyLocation accuracyThe radius around a reported position within which the real position probably lies, such as ±5 m outdoors or ±900 m indoors.Open in glossary →, and it’s one of the most common sources of location bugs.
Pick a condition below and watch the reported position and its radius:
Where does the phone think you are?
- Accuracy radius
- ±5 m
- Off by (this time)
- 4 m
- Time to first position
- 2–5 s
- Source
- GPS + Wi-Fi + cell
Good enough to find the right building entrance.
What this means for testing
- Test outdoors and indoors. The office is the worst place to judge GPS and the best place to find “indoor” bugs.
- Test the first position after a cold startCold startLaunching an app whose process isn't running, the slowest kind of launch, compared with a warm or hot start.Open in glossary →. It can take several seconds outdoors. Does the app show a spinner, a last known position, or nothing?
- Test with approximate location, where the user has told the OS to give the app only a rough area (see App Permissions).
- Test on web separately. A laptop has no GPS, and the browser may ask for permission each time on some sites.
Check this part
The phone reports a position with an accuracy radius of ±900 m. What should a delivery app do?
Why can a laptop browser place you in another city?