Preloader
Others
  • Estimated reading time: 7 Minutes

How Android Location Tracking Actually Works: Developer's Guide

How Android Location Tracking Actually Works: Developer's Guide

If you have built an Android app that requests location, you have dealt with the patchwork of APIs, permissions, and battery trade-offs that make location one of the most misunderstood systems on the platform. If you haven't, you have probably wondered how apps like Google Maps, Find My Device, and family-safety tools pinpoint a phone to within a few meters.

This article breaks down the three location methods Android uses, how the Fused Location Provider chooses between them, what changed with the background-location restrictions in Android 10 through 15, and what it all means for developers building anything that touches location.

The three location sources

Android doesn't have one location system. It has three, and the system blends them depending on what's available and what accuracy the app requested.

GPS (Global Navigation Satellite Systems)

The phone's GNSS chip receives signals from satellites (GPS, GLONASS, Galileo, BeiDou, depending on the chipset). Accuracy is typically 3 to 5 meters outdoors with clear sky. Time to first fix ranges from 2 seconds (hot start, recent ephemeris data cached) to 30 seconds or more (cold start, no cached data).

The trade-off: GPS is the most accurate outdoor method, but it drains battery faster than the alternatives (the GNSS chip draws 25 to 50 mA on most devices), and it fails indoors. A phone inside a concrete building may not get a GPS fix at all.

In code, this is LocationManager.GPS_PROVIDER or, through the Fused Location Provider, a request with Priority.PRIORITY_HIGH_ACCURACY.

Cell tower triangulation

The phone knows which cell towers it's connected to and can see. Each tower has a known location. By measuring signal strength from multiple towers, the phone estimates its position. Accuracy ranges from 100 meters in dense urban areas (many towers, small cells) to several kilometres in rural areas (few towers, large cells).

The trade-off: always available where there's cellular service, minimal battery impact (the radio is on anyway), but accuracy is poor compared to GPS. This is LocationManager.NETWORK_PROVIDER or Priority.PRIORITY_BALANCED_POWER_ACCURACY.

Wi-Fi positioning

The phone scans nearby Wi-Fi access points and matches their MAC addresses against Google's database of known access-point locations (built from Street View cars, Android phones with location enabled, and other sources). Accuracy is typically 15 to 40 meters, and it works indoors where GPS doesn't.

Wi-Fi positioning requires the Wi-Fi radio to scan, which uses less power than GPS but more than cell-only. Since Android 9, background Wi-Fi scanning is throttled (four scans per 2-minute period for foreground apps, one scan per 30 minutes for background).

The Fused Location Provider: how Android chooses

Google Play Services includes the Fused Location Provider (FLP), which abstracts the three sources above. When your app requests location through FusedLocationProviderClient, the system decides which source (or combination) to use based on the priority you set:

PRIORITY_HIGH_ACCURACY: uses GPS plus Wi-Fi plus cell. Best accuracy, highest battery cost. Use this for navigation, fitness tracking, or any use case where meter-level accuracy matters.

PRIORITY_BALANCED_POWER_ACCURACY: uses Wi-Fi plus cell, skips GPS. Accuracy around 40 to 100 meters. Good for city-level location (weather apps, local content).

PRIORITY_LOW_POWER: cell-only. Accuracy around 100 meters to several kilometres. Good for coarse location (country or city detection).

PRIORITY_PASSIVE: no active location requests. The app receives location updates only when another app triggers them. Zero additional battery cost.

The practical advice: request the lowest priority that meets your use case. An app that needs to know the user's city doesn't need HIGH_ACCURACY, and requesting it wastes battery and triggers the "precise location" permission prompt unnecessarily.

The permission model (Android 10 through 15)

Android's location permission model has changed significantly over the past five versions, and each change tightened what apps can do in the background.

Android 10 introduced the split between foreground and background location. Apps must request ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION for foreground use, and separately request ACCESS_BACKGROUND_LOCATION for background access. The background permission is granted on a separate prompt.

Android 11 removed the ability to request background location at the time of install. The user must first grant foreground permission, use the app, and then be directed to Settings to grant background access manually. This added friction reduced background-location grants significantly.

Android 12 added the "approximate location" toggle. Users can grant precise (GPS-level) or approximate (city-level) location. Apps that only need city-level location should work with approximate grants, and the system encourages this by defaulting to approximate.

Android 14 and 15 continued tightening with stricter background-process limits and health-connect location integration. The trend is clear: each version makes it harder for apps to access location without explicit, informed user consent.

For developers, this means: design your location flow assuming the user will grant only foreground, approximate location. Build your app to work with that, and request higher precision or background access only when you can explain why to the user in context.

Background location: the hard problem

Background location is where most developer frustration lives, because Android actively works to prevent it.

The Doze and App Standby systems throttle background work when the phone is idle. The background location limits in Android 10 and above restrict how often background apps receive updates. Manufacturer-specific battery optimizations (Xiaomi's MIUI, Samsung's One UI, Oppo's ColorOS) add another layer of restrictions that go beyond stock Android.

The result: a background location app that works perfectly on a Pixel may stop receiving updates after 15 minutes on a Xiaomi phone, because MIUI killed it to save battery. This isn't a bug in your code. It's the OEM's battery management doing exactly what it's designed to do.

The workarounds: use a foreground service with a persistent notification (the standard for navigation and tracking apps). Use WorkManager for periodic location checks (less precise but battery-friendly). Use the Geofencing API for enter/exit events (the system manages the location checks, not your app). And test on MIUI, One UI, and ColorOS devices specifically, because stock-Android testing misses half the real-world problems.

How commercial tracking apps work

Apps like Google Find My Device, Life360, and phone tracker tools for family safety use the same APIs described above. The core technique is a foreground service (the persistent notification you see when a tracking app is running) that requests HIGH_ACCURACY location at a regular interval (every 30 seconds to every 5 minutes, depending on the app and the use case).

The foreground service is the key. Without it, Android will eventually kill the app's background process, and location updates stop. The persistent notification is the trade-off: the user knows the app is running, and the system keeps it alive.

Some apps also use the Geofencing API to trigger alerts when the phone enters or leaves a defined area, without continuous GPS polling. This is more battery-efficient for use cases like "alert me when my child leaves school" than continuous tracking.

The accuracy these apps achieve in practice depends on the environment: 3 to 10 meters outdoors with clear sky (GPS dominant), 15 to 50 meters indoors or in urban canyons (Wi-Fi dominant), and 100 meters or more in areas with poor cellular and no Wi-Fi (cell-only). The marketed "real-time tracking" is accurate, but only as accurate as the underlying sources allow.

What developers get wrong

Three common mistakes I see in production apps:

  • Requesting HIGH_ACCURACY for everything. If your app shows nearby restaurants, you don't need 3-meter accuracy. BALANCED_POWER gives you 40-meter accuracy at a fraction of the battery cost. The user notices the battery drain before they notice the accuracy difference.
  • Not handling the "approximate only" grant. Since Android 12, users can grant approximate location. If your app crashes or degrades badly when it receives approximate coordinates, you've shipped a bug that affects a growing percentage of users.
  • Ignoring manufacturer-specific battery management. If you haven't tested on a Xiaomi phone with MIUI's aggressive battery optimization, your location-tracking feature doesn't work for roughly 20 percent of Android users globally. Test on MIUI, One UI, and ColorOS. Add autostart and battery-unrestricted documentation for your users.

The privacy angle

Location is the most sensitive permission on a phone. The data reveals where a person lives, works, worships, who they visit, and what medical facilities they attend. As a developer, you have a responsibility beyond the technical.

Request only what you need. If coarse location serves the use case, don't request fine. If foreground serves the use case, don't request background. The principle of least privilege isn't just a security concept. It's a user-trust concept.

Be transparent about what you collect. Your privacy policy should state what location data you collect, how often, what you use it for, who you share it with, and how long you retain it. This isn't just ethical. It's required by Google Play policy and by regulations like GDPR, CCPA, and India's DPDP Act.

Delete what you don't need. If your app collects location history for a feature the user stopped using, delete it. Storing location data you no longer need is a liability, not an asset.

Wrapping up

Android location is a three-source system (GPS, cell, Wi-Fi) managed by the Fused Location Provider, restricted by an increasingly strict permission model, and complicated by manufacturer-specific battery management. The fundamentals haven't changed in years, but the permission and background-process landscape changes with every Android version.

Build for the minimum permission your feature needs. Test on manufacturer-skinned devices, not just Pixels. And treat location data with the seriousness it deserves, because your users' movements are the most personal data their phone collects.

Related articles
Submi Ranked the Best Directory Submission Service of 2026
1 Dec, 2026
  • Estimated reading time: 24 Minutes
The Silicon Dollar Debate: What Pax Silica and the Data Show
30 Nov, 2026
  • Estimated reading time: 7 Minutes
Before You Lose Your iPhone: A 10-Minute Setup
30 Nov, 2026
  • Estimated reading time: 5 Minutes
Weekly trending
Submi Ranked the Best Directory Submission Service of 2026
1 Dec, 2026
  • Estimated reading time: 24 Minutes
The Silicon Dollar Debate: What Pax Silica and the Data Show
30 Nov, 2026
  • Estimated reading time: 7 Minutes
Before You Lose Your iPhone: A 10-Minute Setup
30 Nov, 2026
  • Estimated reading time: 5 Minutes
Our Sponsors

Our blog is proudly supported by industry-leading sponsors.