androidgeolocationgpsandroid-gps

How does LocationManager.NETWORK_PROVIDER really work?


I see that LocationManager.NETWORK_PROVIDER.getLastKnownLocation() returns the last location, but how is the location updated? If the GPS is disabled, will it entirely rely on BSSIDs detected by WiFi? What if the WiFi is also disabled? Does it take mobile service tower data into account?


Solution

  • Yes, the location service has basically three levels: GPS, WiFi, Cell tower.

    GPS is used with the GPS_PROVIDER, and WiFi and cell tower go both into the NETWORK_PROVIDER bucket.

    To quote the NETWORK_PROVIDER description:

    This provider determines location based on availability of cell tower and WiFi access points. Results are retrieved by means of a network lookup.