17

I read that Android (and similar operation systems, e.g. iOS) get the current coarse location by using either WiFi or GSM tower triangulation. I get the basic idea but have questions about the details.

  1. Does Android normally use both methods, or does it prefer one and fall back to the other?
  2. Does it communicate with a server to get the position via WiFi? (e.g. sending the SIDs of the WiFis to a web service)
  3. Does it communicate with the carrier to get the position via the GSM towers or is this done on the device?

4 Answers 4

9

It is really up to the developer as to how to implement the location service. The full description is available on the Android Developers official site (as captured on 24 Sep 2010)

The graph about 1/3rd down the page is pretty useful to see what a typical app might do, but again, it is completely up to the app developer. The location service types are:

  • Cached Fix
  • Cell-ID
  • WiFi
  • GPS
  • Mock Location

If the app requests permission for coarse location only, it will not use the GPS to determine location.

To answer your questions:

  1. It is up to the individual app developer, but in most cases, the sequence will be Cached Fix, Cell-ID, WiFi, GPS, in that order.
  2. Yes, after acquiring the tower IDs or SSIDs of the WiFi signals, that data is transmitted to Google to determine a rough location.
  3. No, Google has done something really clever here. Google has their own database of cell tower locations and does not require an interaction with the carrier to determine the location of the tower.

An article by Francisco Kattan on "Dynamic Cell-ID" has some of the detail. The short version is that, when you use an app like Google Maps, the app will send the current Cell-ID information back along with your current GPS fix. In this way, Google gets a very good sampling of the signal strengths in various locations and is able to build a very rich database.

2
  • 1
    I like your answer pretty much, but I'm not sure if your right on the "it's totally up to the developer"-part. As far as I can tell, the developer can only decide to get the fine or the coarse location. In other words he can use the LocationManager.NETWORK_PROVIDER and/or LocationManager.GPS_PROVIDER to obtain the location. I think he can not decide or even see, if Wifi or GSM is used, right?
    – Tim Büthe
    Sep 29, 2010 at 10:25
  • In the most common case, the developer will not care if the data is coming from WiFi or Cell-ID, but the dev could put in restrictions to only allow the app to work when WiFi is disabled or GPRS/GSM is disabled. I took your question to mean: "Is there a standard sequence that all apps follow" and the answer to that is no. However, with specific regard to the difference between WiFi and Cell-ID, the app developer has limited capability to specifically request one type of location service.
    – JadeMason
    Sep 29, 2010 at 13:43
3

A lot of this is carrier-specific and I'm not a dev but here's what I could piece together from the interwebs and the trainings I've had in electronic crime investigation:

  1. Yes, but it depends on the specific apps LBS priorities which are set by the dev and can be based on current course accuracy, power levels, predefined priorities, etc.
  2. Yes. The carriers have proprietary WiFi base station location DBs.
  3. I can't speak to Android specifically, but generally, this is going to be the carrier and network type (CDMA or GSM). Phones are capable of both, but at least a few years ago they did this work on the handset because of the bandwidth constraints of doing it OTA.
1
0

Your phone knows what the closest towers are.

There is a provider database for each country in which the location of tower IDs on the map is stored. This database might be small enough to be preinstalled by your provider or supplied over the air. How an Android phone gets this data, I don't know.

-1

Does it communicate with the carrier to get the position via the GSM towers or is this done on the device?

The device could be used if you want to use triangulation, but you need to use the carrier if you want to match the Cell-ID and the localization of the GSM (or CDMA) tower.

6
  • but is this an option that can be determined by an app developer or even an end user or is it something that is determined by the carrier?
    – Matt
    Sep 27, 2010 at 20:59
  • It is mandatory, if you want to use this way for localizing a device. Using triangulation or another method allows you to know where you are versus antenna position. But if you don't know the lat/long of the antenna, you won't be able to get your position on a map. I home I'm clear :)
    – Rob
    Sep 28, 2010 at 7:43
  • @Rob But you don't need the carrier to find the location of the tower. Each tower broadcasts a unique ID, anyone can independently pick that up and map it, with no carrier interaction. Google have been doing this for a while for cell towers and WiFi access points. The Google Streetview car picks the info up as it travels, and users of Google Maps on various platforms also send back anonymous data matching GPS fixes with antenna and wifi IDs and strength. This is similar to how Google pick up a lot of their traffic data in cities, they aggregate speed and positions from lots of Maps users.
    – GAThrawn
    Sep 29, 2010 at 10:28
  • Are you sure ? Looks surprising. For instance, in Germany (and other countries in Europe), Google has been sued for collecting wifi information, so looks like they did not use this resource. For the GSM database, if Google owns one, it should be accessible, and I never heard about it.
    – Rob
    Sep 29, 2010 at 13:40
  • 1
    @Rob googlemobile.blogspot.com/2008/06/… "The phone knows the ID of the cell tower that it's currently using. If the phone has GPS, the Maps application on the phone sends the GPS coordinates along with the cell ID to the Google location server." can't find the link right now but they announced a while ago that the Blackberry Google Maps app was sending back nearby WiFi SSID and strength for the same reason. This isn't the same as the programming "error" in the Streetview software they're being sued over that captured more WiFi data than it was meant to.
    – GAThrawn
    Sep 30, 2010 at 11:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .