Thursday, April 30, 2015

Many iPhone users may have wondered why Apple prompts them with a message saying “Location accuracy is improved when Wi-Fi is turned on” each time they choose to turn Wi-Fi off. Why does a phone that has GPS (Global Positioning Satellite) capability need to use Wi-Fi to determine it’s location?

The reason is fairly simple. There are of course thousands of radio frequencies traveling through the
walls of buildings all around us. What makes Wi-Fi frequency (or even bluetooth) particularly useful
for location mapping is that the frequency travels a relatively short distance before it decays, due to how low energy the Wi-Fi wavelengths are. A combination of three or more Wi-Fi signals can be
used in a very small area by a phone to triangulate locations on a map
in the same manner that earthquake shockwave strengths can be used to triangulate
epicenters. Wi-Fi hubs don't need to transmit their locations to
be useful. Most are oblivious of their location. It is the phone's interpretations of their signal strength and inferred location that creates the value to the phone's internal mapping capabilities. No data that goes over the Wi-Fi frequency is relevant to using radio for triangulation. It is
merely the signal strength/weakness that makes it useful for
triangulation. (Most Wi-Fi hubs are password protected and the data sent over them is encrypted.)

Being able to let phone users determine their own location is of keen interest to developers who can’t make location-based-services work without fairly precise location determinations. The developers don't want to track the users per se. They want the users to be able to self-determine location when they request a service at a precise location in space. (Say requesting a Lyft ride or checking in at a local eatery.) There are a broad range of businesses that try to help phones accurately orient themselves on maps. The data that each application developer uses may be different across a range of phones. Android, Windows and iPhones all have different data sources for this, which can make it frustrating to have consistency of app experience for many users, even when they’re all using the same basic application.

At Mozilla, we think the best way to solve this problem is to create an open source solution. We are app developers ourselves and we want our users to have consistent quality of experience, along with all the websites that our users access using our browsers and phones. If we make location data accessible to developers, we should be able to help Internet users navigate their world more consistently. By doing it in an open source way, dozens of phone vendors and app developers can utilize this open data source without cumbersome and expensive contracts that are sometimes imposed by location service vendors. And as Mozilla we do this in a way that empowers users to make personal choice as to whether they wish to participate in data contribution or not.

How can I help? There are two ways Firefox users can get involved. (Several ways that developers can help.) We have two applications for Android that have the capability to “stumble” Wi-Fi locations.

The first app is called “Mozilla Stumbler” and is available for free download in the Google Play store. (https://play.google.com/store/apps/details?id=org.mozilla.mozstumbler) By opening MozStumbler and letting it collect radio frequencies around you, you are able to help the location database register those frequencies so that future users can determine their location. None of the data your Android phone contributes can be specifically tied to you. It’s collecting the ambient radio signals just for the purpose of determining map accuracy. To make it fun to use MozStumbler, we have also created a leaderboard for users to keep track of their contributions to the database.

Second app is our Firefox mobile browser that runs on the Android operating system. (If it becomes possible to stumble on other operating systems, I’ll post an update to this blog.) You need to take a couple of steps to enable background stumbling on your Firefox browser. Specifically, you have to opt-in to share location data to Mozilla. To do this, first download Firefox on your Android device. On the first run you should get a prompt on what data you want to share with Mozilla. If you bypassed that step, or installed Firefox a long time ago, here’s how to find the setting:

1) Click on the three dots at the right side of the Firefox browser chrome then select "Settings" (Above image)

2) Select Mozilla (Right image)

Check the box
that says “Help Mozilla map the world! Share approximate Wi-Fi and
cellular location of your device to improve our geolocation services.” (Below image)
If you ever want to change your settings, you can return to the settings of Firefox, or you can view your Android device's main settings menu on this path: Settings>Personal>Location which is the same place where you can see all the applications you've previously granted access to look up your physical location.

The benefit of the data contributed is manifold:
1) Firefox users on PCs (which do not have GPS sensors) will be able to determine their positions based on the frequency of the WiFi hotspots they use rather than having to continually require users to type in specific location requests.
2) Apps on Firefox Operating System and websites that load in Firefox that use location services will perform more accurately and rapidly over time.
3) Other developers who want to build mobile applications and browsers will be able to have affordable access to location service tools. So your contribution will foster the open source developer community.

And in addition to the benefits above, my colleague Robert Kaiser points out that even devices with GPS chips can benefit from getting Wi-Fi validation in the following way:

"1)
When trying to get a location via GPS, it takes some time until the chip actually has seen signals from enough satellites to determine a
location ("get a fix"). Scanning the visible wi-fi signals is faster
than that, so getting an initial location is faster that way (and who
wants to wait even half a minute until the phone can even start the
search for the nearest restaurant or cafe?).
2) The location from
this wifi triangulation can be fed into the GPS system, which enables it
to know which satellites it roughly should expect to see and therefore
get a fix on those sooner (Firefox OS at least is doing that).
3) In
cities or buildings, signals from GPS satellites get reflected or
absorbed by walls, often making the GPS position inaccurate or not being
able to get a fix at all - while you might still see enough wi-fi
signals to determine a position."

Thank you for helping improve Mozilla Location Services.

If you'd like to read more about Mozilla Location Services please visit:
https://location.services.mozilla.com/
To see how well our map currently covers your region, visit:
https://location.services.mozilla.com/map#2/15.0/10.0
If you are a developer, you can also integrate our open source code directly into your own app to enable your users to stumble for fun as well. Code is available here: https://github.com/mozilla/DemoStumbler
For an in-depth write-up on the launch of the Mozilla Location Service please read Hanno's blog here: http://blog.hannosch.eu/2013/12/mozilla-location-service-what-why-and.html
For a discussion of the issues on privacy management view Gervase's blog:
http://blog.gerv.net/2013/10/location-services-and-privacy/