Wednesday, July 31, 2019

geolocation - How does Android get the coarse location?


I read that android (and simmilar operation sytems 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 comunicate with a server to get the position via WiFi? (e.g. sending the SIDs of the WiFis to a webservice)

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



Answer



It is really up to the developer as to how to implement the location service. The full description is available here:


http://developer.android.com/guide/topics/location/obtaining-user-location.html


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.


This article has some of the detail http://franciscokattan.com/2010/02/06/dynamic-cell-id-clever-way-to-block-google-but-will-it-backfire/


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.


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...