How to detect mobile location using GPRS?

Iman Hejazi picture Iman Hejazi · Jan 13, 2012 · Viewed 54.6k times · Source

As you know, Google maps program for Mobiles has the ability to find users location (My Location service). I want to know how Google Maps can detect users location using internet mobile, GPRS (Not GPS)? and is it possible to write a program in PHP or other web-based languages that can detect users location when they open that page? I can guess that Google doesn't use users IP in order to determine their location because when I tried to guess my location using my Mobile internet IP a wrong location is obtained.

Answer

boettger1 picture boettger1 · Jan 22, 2012

In the absence of a GPS fix, a common way to do positioning is to do a reverse lookup of the serving cell ID or of a detected Wi-Fi MAC address. A server-based database exists which gives the geolocation of all known cell sites -- which are uniquely identified by their cell ID, or more precisely, their Cell Global ID (CGI), as well the location of all known Wi-Fi APs. Thus, knowing the CGI or MAC, one can determine one's approximate ("coarse") location by doing a dip into the database over a cellular data collection like GPRS. This how commercial services like SkyHook (which Apple used to use, but no longer uses) work.

This coarse position can be made somewhat more precise by using additional inputs such as signal strengths or digital maps.

Some devices -- like iPhones -- cache this database on-device so as to make coarse-resolution positioning faster. Apple got in trouble for this a few months back and has since changed how this works.

In order for a web page to know the device's location, the device would have to call the appropriate (device-specific) positioning API and then submit it to the web server, which obviously requires some device-side code (not just a browser).