Building the Mozilla Location Service

Posted on Mon 24 February 2014 in misc

tl;dr Mozilla is building a location service and you can help by running MozStumbler on your Android device.

Map showing Northern Ontario with line from Sudbury to Ottawa

Last week I drew the blue line from Sudbury to Ottawa you see in the above map by running MozStumbler on my phone as we headed out to celebrate Winterlude. One day, that line might help you figure out where you are on your FirefoxOS phone! Here's what's going on:

GPS triangulates your position based on satellites, requires a line of sight to those satellites, and can take minutes to get a lock on your location. If you have a smartphone, you've probably noticed that running a maps application will return your location in seconds, not minutes; that's because modern smartphones use cell towers and wifi routers for triangulation purposes.

Unlike GPS, your phone is usually continuously scanning for cell and wifi routers, so the data is immediately available at no extra cost to your phone's battery or CPU.

However, while the major smartphone operating system manufacturers have built databases that correlate cell towers and wifi routers with coordinates (and raised some privacy concerns while they were at it - Apple, Google), this data is not openly available. A new operating system, such as Mozilla's FirefoxOS, must licence a service such as Skyhook's, or build their own.

True to its open principles, Mozilla is building its own database of location information--the Mozilla Location Service--that aims "to provide an open service to provide location data" (that page needs wordsmithing but I digress). To collect the data, Mozilla offers an Android application called MozStumbler that you can run while you're out and about; it will build a collection of coordinates with wifi access points and cell towers, and then upload it to Mozilla (either via your data connection, or later when you have wifi connectivity if you prefer).

Currently you have to sideload the APK onto your phone; it is not available on the Google Play Store (although it is on F-Droid). While the fledgling location API is already available, it remains to be seen how Mozilla will run this service: if, for example, it will make data dumps available, or if it will rate-limit calls to the service. But given Mozilla's long and laudable track record, it seems worthwhile to trust that they will do the right thing and help them build their database.

They have a long way to go. Comparing Mozilla's stats to Skyhook's, Mozilla has collected observations about 0.7 million cell towers and 17.5 million wifi access points, vs. Skyhook's 30 million and 1 billion respectively.

So why not fire up MozStumbler on your phone? Hey, if a lowly guy from Sudbury can, in a little over a week, get into the top 200 data contributors (me = ``dbs`` and yes it was smart of Mozilla to gamify this effort), I have no doubt that my peers in more heavily inhabited locations can blow past me in no time!