}}}
[[http://www.amazon.com/gp/product/1449394639/ref=as_li_tf_tl?ie=UTF8&tag=4ourthmobile-20&linkCode=as2&camp=217145&creative=399373&creativeASIN=1449394639|{{attachment:wiki-banner-bonus.png|Click here to buy from Amazon.|align="right"}}]]Appropriate use of sensors is one of the key methods to make mobile devices behave in a useful, intelligent manner. Most of these are fairly easy to comprehend. A camera is a camera, and even [[http://en.wikipedia.org/wiki/Accelerometer|accelerometers]] are understandable in a general sense with only minimal exposure.
[[http://en.wikipedia.org/wiki/Location-based_service|Location services]], however, are very complex due to their scale, the opacity of the operation, and poor choices in marketing communications. The most important thing for understanding location technology on mobile devices is to never, ever, ever conflate “GPS” with “location.” We discussed the numerous technologies briefly in the [[Location]] pattern. Longer descriptions of the same are provided in this appendix.
The following are key guidelines to keep in mind when designing location services on mobile devices:
* Every phone is location-enabled. GPS or not, working or not, there’s some location available as long as it is attached to the network. If your service offers up a weather report or local news, a few thousand yards is practically pinpoint precision. Most wirelessly-connected devices are or can be location-enabled as well.
* All the available location technologies must be addressed when designing your application or service. Don’t disable the whole service, even if it’s about something that seems to require precision such as mapping, just because the GPS is off.
* [[http://en.wikipedia.org/wiki/Accuracy_and_precision|Precision and accuracy]] must be understood by designers, and correctly exploited by the product. When the GPS is off, or doing badly, show the CEP circle so that it’s clear that we don’t know “exactly’’ where you are. Admit the same lack of precision in text; say “Turn right in ‘about’ one-quarter of a mile,” and so on.
* If you work for a [[http://en.wikipedia.org/wiki/Mobile_operator|carrier]], exploiting the network like this should be a snap. If not, your devices or software may or may not be able to talk to the phone enough, and you might need to negotiate with the carrier or find a third-party provider. There are providers of location services that have already set up agreements with the operators.
* Consider what to store locally. Does the handset really need to be on the network, or should you give some functionality when the connection is bad or unavailable?
* Look useful without acting creepy. And don’t just follow the letter of the law. Be careful with your user’s data, share only what is needed, and store only what you really have to. Often, these last two are answered as “nothing.” If that is the decision, make sure it’s implemented as such, and no one gets lazy with the development or doesn’t get the memo. Don’t keep location information that is not relevant anymore, and be sure to encode information that has to be stored. Presence is considered [[http://en.wikipedia.org/wiki/Privacy#Privacy_and_location-based_services|personal information]], so it will be perceived as a breach of confidence, even if not a breach of law.
== Location Technologies ==
As we have already mentioned, GPS is not the only location technology available. A whole series of them are employed, and work together to give a sense of location to any device. Whenever possible, these technologies are listed from least to most precise.
=== Cell ===
Mobile telephony is based on communications and handoff between cells, each of which is (generally) controlled by a single base station, generally on a tower with multiple antennas. The entire assemblage of tower, antennas, transmitters, shed to house it in, and so on is called a Base Transceiver Station or BTS. More about this can be found in the previous section [[An introduction to mobile radiotelephony]].
The tower location is well known, and its ID is attached to the [[http://en.wikipedia.org/wiki/Call_detail_record|call data record]] (used for billing and network control purposes), so it can be used by certain systems.
This is excellent as a fallback, when other things are not available. Better technologies are generally not available when [[http://en.wikipedia.org/wiki/Roaming|roaming]], and the data is not or cannot (due to technology or politics) be shared at more precision with your home network or because you are from another operator.
Precision will vary widely by the size of the cell, and there is no (good, universally accepted) method to determine and communicate precision and accuracy to the handset or any systems that use it. A good rule of thumb—and something similar is generally used by devices—is to assume the device falls within a circle 3,000 yards (m) across, though this varies by the technology used.
=== Sector ===
Recall that each tower has multiple antennas. Those three antennas (or four, depending on the technology and carrier implementation) point in different directions to cover an entire circle. Each of those is an independent mobile radio [[http://en.wikipedia.org/wiki/Sector_antenna|sector]]. Just like signals are handed off between cells, they are handed off between sectors, and the data is generally known to the handset and can sometimes be shared with services or providers. However, since the direction the sector faces is really only known to the company that installed it, and the network operator, they are the only ones that can use the data well.
Precision will vary widely by the size of the cell, the antennas used, the number on the cell, the down-angle, and so on. There are some semi-useful ways to determine precision and accuracy for a single read, but they are not universally implemented and there is no way to send the data to the information providers (e.g., the map program). A good rule of thumb—and something similar is generally used by devices—is a circle 1,200 yards (m) across, collocated with the radio [[http://en.wikipedia.org/wiki/Centroid|centroid]] of the sector (which can be determined from maps and some educated guesswork; others have already done this). Yes, sectors are not circles, but it’s also hard to communicate shape and orientation, so this works.
=== Triangulation ===
In general terms, [[http://en.wikipedia.org/wiki/Triangulation|triangulation]] is the practice of determining the location of a point by measuring the angle and/or distance from several known locations. More points give more precision. It can get more complex when you try to find points in 3D space, but all mobile triangulation systems mostly assume the Earth is locally perfectly flat, and simply find the location on the [[http://en.wikipedia.org/wiki/Geoid|geoid]]. Methods of triangulating get really complex and vary by network type and equipment available; [[http://en.wikipedia.org/wiki/Multilateration|multilateration]] and [[http://en.wikipedia.org/wiki/Interpolation#Interpolation_in_digital_signal_processing|signal interpolation]] are some of those. The math can get pretty harrowing.
Precision varies mostly by the number of sectors being used, the distance between them, and other variables of the network. There may be a method of communicating to services employing it an approximation of the precision available. In any remotely built-up area, where it most often has enough sectors to work, a circle 50 yards (m) across is typical; 12 yard precision is possible, with good accuracy.
=== GNSS Telemetry ===
The [[http://en.wikipedia.org/wiki/Global_Positioning_System|Global Positioning System]] is a [[http://en.wikipedia.org/wiki/Gnss|GNSS]] (Global Navigation Satellite System) consisting of a ground-based control system, a series of satellites, and any number of anonymous receivers. So, reading that alone dismisses many misconceptions; it’s one-way, it’s a system, and the signal is from satellites and has nothing to do with mobile networks.
[[http://en.wikipedia.org/wiki/Telemetry|Telemetry]] means data sent from a remote (usually mobile) site such as a rocket, back to base. Here it means the device figures out where it is by listening to the satellites, then tells the network or website or whatever where it is.
GPS can yield precision to fractions of an inch at least. But those are large, complex devices used for special surveying and scientific tasks, and require the antenna to be fixed to the ground for a period of time, and then rotated for reasons not worth getting into here. Portable, handheld receivers like those in mobile handsets can generally be assumed to give precision of 20 to 50 feet, though antenna and signal processing improves constantly and precision can be in single-digit feet.
[[http://en.wikipedia.org/wiki/Selective_Availability#Selective_availability|Selective availability]] is the capability of the US government to partly or entirely disable the commercial GPS network so that enemy forces cannot use the system. Military receivers are functionally identical, but use a special, coded signal instead. In practice, this is unlikely to ever take place outside of a global catastrophe in which you won’t much care about GPS anyway.
However, it exemplifies the theoretical risk of a major system being held by a single country. Therefore, there are other national and regional GNSSes, including [[http://en.wikipedia.org/wiki/Galileo_(satellite_navigation)|Galileo]], [[http://en.wikipedia.org/wiki/GLONASS|GLONASS]], and [[http://en.wikipedia.org/wiki/Compass_navigation_system|COMPASS]] as well. The Russian GLONASS just achieved full availability in late 2011, and is beginning to be offered as the GNSS service in Russian mobiles, as well as a secondary system alongside GPS for many devices. In theory, using multiple unrelated systems will give better accuracy yet, and give better coverage when in touchy situations like in dense cities. The others are quite early and do not offer full capability yet.
=== WAAS ===
GPS uses radios, and the atmosphere and Earth are imperfect and can displace or distort the signals. [[http://en.wikipedia.org/wiki/Waas|WAAS]] is a [[http://en.wikipedia.org/wiki/GNSS_augmentation|satellite-based augmentation system]] based in [[http://en.wikipedia.org/wiki/File:WAAS_GEO_Footprint_March_2010.jpg|North America]] (others exist in the rest of the world, but are less well established) that sends additional signals via another set of satellites to allow GPS receivers to adjust for those inaccuracies. I know of no mobile phones that have a built-in WAAS receiver, but it’s a location technology that does exist, is almost universally used on every dedicated GPS device, and is employed on BTSes using AGPS.
=== AGPS ===
[[http://en.wikipedia.org/wiki/Assisted_GPS|Assisted GPS]] requires the use of mobile networks, so it only works when in data communication range. The BTS has its own GPS receiver (which many already have in order to get precise time signals), and usually a WAAS receiver. AGPS provides a bit more preci- sion, assures it of more accuracy, but mostly helps speed up cold or warm starts.
Briefly, for a GPS to work, the receiver has to download data about all the satellites before it can calculate the position. AGPS [[http://en.wikipedia.org/wiki/Cache|caches]] this info for the phone, and sends over just the relevant bits, cutting minutes to a second or two.
This is a reason you may not see WAAS, and might see some benefits from another GNSS (say, GLONASS) before the receivers are added to the handsets. AGPS generally gives precision, even in dense areas and on the move, of 10 feet or better. Two-foot indicated precision has been observed.
AGPS is not generally selectable as a separate service; when the user chooses to turn on or off “GPS” and has a network connection (and an AGPS-compliant phone, etc.), he gets the advantages of AGPS if it is available on the network and BTS. You can often see this at work, as your location will be almost perfect when in a home network, but suddenly be worse when traveling. Check, and you will probably be roaming, and therefore incapable of communicating with the AGPS features of the roaming network BTS.
=== WLANs & PANs ===
Local networks such as [[http://en.wikipedia.org/wiki/Wifi|WiFi]] and [[http://en.wikipedia.org/wiki/Bluetooth|Bluetooth]] are not exactly more precise, but are at the bottom of this list because they are local, and can add another layer of location, so they could increase precision. They can also be used instead of other technologies when there is no GPS signal or a bad mobile signal in which triangulation cannot be used.
Both of these currently use the “cell” (or network identifier) and triangulation methods described earlier, but with their transmitters. There are no sectors, and no universally adopted AGPS to work with device telemetry. Naturally, a handset getting good GPS data can send that telemetry to anyone over any network, including WiFi, but that’s not the same thing.
They are both relatively rarer, and often are supported by third-party software or individual services (which may have specific capabilities), and are not universally implemented on the handset. There are no reliable, independently verified numbers on the real-world precision, but tests of WiFi triangulation alone have gone down to inches. On the other hand, poor network identification has led to placing users on the wrong continent. There’s room to improve here.
=== Ask ===
People often know where they are. If you cannot get any location, or there’s a reason your users might want to override it (even as simple as the data is bad), let them enter a location. Never override user-entered data—at least not without providing a warning.
If you do this, allow lots of methods and think about what the user knows, and is comfortable with. Do not require a street address unless it is really needed. Do not use simple entries such as a zip (or postal) code, if the user is unlikely to know it, such as when traveling.
== Key Topics in Implementing Location Services ==
=== Location is not just GPS ===
All of the above is pretty well known by network engineers, chip makers, and various low-level handset software designers. But it is often missed a bit by various software implementations (and certainly by marketing). All too often GPS “is" navigation, such that turning it off kills all location services. Certain systems are becoming aware of this, and (for example) just give poorer precision when you turn the GPS off, but they do allow location services to work.
=== Vertical accuracy ===
Vertical location is not known with many systems, and is much worse than the horizontal accuracy even with GPS/AGPS. Consider this in your design if users in buildings or even just multilevel roadways are likely to be encountered. Technology may not reveal the vertical position with sufficient fidelity for the system to respond usefully. But if you can derive vertical location, start thinking about using it. A person 120 feet off the ground does not want a coupon for the Starbucks across the street; he’s probably in a meeting or at his desk in a building. Eventually, map data should account for this, and even simple, obvious things like multilevel roadway navigation will also become easier.
=== Precision vs. accuracy ===
Precision and accuracy are often confused. A quick primer: precision is the number of decimal places you measure something to; accuracy is how correct it is. The less accurate a measurement is, the less precisely it should be reported. Practically every location system gives location to the same degree of precision (e.g., 1 meter, using full UTM precision) at all times, and presumes the accuracy measure will be considered as well.
Visual representations are similar. The moving arrow (or car, or person icon) is the cen- troid of the current location precision circle. Even when that accuracy circle is displayed, the centroid marker implies much higher precision than is actually being achieved. Consider better ways to represent location to avoid user confusion.
=== Appropriateness of Information ===
Display of information services should be related to the current accuracy. For example, turn-by-turn directions always assume perfect location precision (using the centroid of the current location accuracy circle), and say “You have arrived.” But a person helping you navigate would instead say “It’s the big, white building on the north side of the street,” and probably point at it. What if the location is vague and the target or turn is 30 yards behind you, or 50 yards in front of you? The user is confused. Close roads (in dense cities), multitier highways, and other situations can exacerbate the effect of this behavior.
Design to accommodate imperfect location instead.
=== Data Integrity and Reliability ===
If your map might be wrong, or imprecise or inaccurate (and they all might be), you should think about this when planning the interaction. Don’t assume your data is perfect, and give contextually helpful information. Let users note problems, and do something with the problem reports.
=== Local vs. Network Storage ===
Handheld dedicated GPS units and most in-car units store map data locally, so when a GPS fix is found, a map can be displayed immediately. Mobiles generally assume functionality only when on the network, even when a GPS is included. If your service is usable when out of network range (e.g., it’s just for navigation, not for social media or communications), consider storing or caching enough information locally for the device to work when out of network coverage.
== Interior Location ==
All the location services described above assume a relatively clear line of sight to satellites or radio sources, and when not available simply assume the signal is lost or degraded. But an increasingly interesting field is interior, or indoor location where all traditional location services are unavailable or degraded.
Some of these, such as WiFi and PAN are the same, but other factors of technology and design come into play, so as these become more settled, I will try to add additional information.
== Direction ==
Another related aspect which will be expanded upon here eventually is that of direction. Magnetometers and accelerometers can be used to tell which way the device is pointing. While moving, track information can be used to provide direction information by GPS and sometimes other location services.
These are very important to provide accurate information for even basic location services like turn-by-turn directions. Augmented reality requires very precise direction information, and other services can also use this as well.
== External References ==
* [[http://en.wikipedia.org/wiki/Base_Transceiver_Station|Cell definition]]
* [[http://www.antennasearch.com/sitestart.asp?sourcepagename=antennachecktowerreview&getpagename=pgtowerdetail_fcc&cmdrequest=getpage&ipos=11®istration_number=1006513|A tower locator]]
* [[http://www.privateline.com/mt_cellbasics/iii_cell_sector_terminology/|Sector definition]]
* [[http://en.wikipedia.org/wiki/Triangulation|Triangulation defined at Wikipedia]]
* [[http://en.wikipedia.org/wiki/Multilateration|Multilateration discussed at Wikipedia]]
* [[http://en.wikipedia.org/wiki/Gps|GPS system]]
* [[http://pnt.gov/public/sa/|Selective Availability (GPS)]]
* [[http://en.wikipedia.org/wiki/Galileo_(satellite_navigation)|Galileo satellite nav system]]
* [[http://en.wikipedia.org/wiki/GLONASS|GLONASS satellite nav system]]
* [[http://en.wikipedia.org/wiki/Compass_navigation_system|COMPASS satellite nav system]]
* [[http://en.wikipedia.org/wiki/Wide_Area_Augmentation_System|WAAS defined]]
* [[http://en.wikipedia.org/wiki/Assisted_GPS|AGPS outline at Wikipedia]]
* [[http://en.wikipedia.org/wiki/Wireless_LAN|WLAN definition]]
* [[http://en.wikipedia.org/wiki/Personal_area_network|PAN definition]]
-------
Next: [[Introduction to NFC]]
-------
= Discuss & Add =
Please do not change content above this line, as it's a perfect match with the printed book. Everything else you want to add goes down here.
== Precision is Not Accuracy ==
And thinking so is biting location-based-advertisers in the ass.
http://www.mediapost.com/publications/article/211427/is-latlong-getting-it-all-latwrong.html#axzz2iMlFrJrk
''Twenty-six percent of reported locations were off by over 10,000 meters, while less than 33% were accurate within 100 meters. To put this in context, if a luxury car dealer wanted to target high-end shoppers on 5th Ave. in Manhattan, 1 in 4 of their ads could unintentionally show up in residential New Jersey. Not only that, but more than 42% of impressions were off by at least 3,500 meters. So in this example, the data showed that the luxury shopper is just as likely to be an NYU college student playing "Angry Birds" at Washington Square Park as they are to actually be a 5th Avenue shopper.''
== New Technology Articles ==
Now that multi-sensor location is getting serious, there are some people writing generally about it:
* http://www.gpsworld.com/Wireless/expert-advice-getting-accurate-everywhere-location-12540 A little nerdy, as it's from a GIS news site, but it covers it well (as of Jan 2012) once you get past the acroynms.
Shadow matching. Pretty cool. Uses models of the buildings/cliffs blocking your signal to tell more precisely where you are... based on the fact that you /cannot/ see a satellite. Counter-intuitive use of sensors.
* http://www.gpsworld.com/Wireless/Personal%20Navigation/shadow-matching-12550
== Shopkick Audio Location ==
Indoor location with... sound? Weirder than you'd think, and a brilliant solution. I cannot believe I missed this.
* http://scobleizer.com/2010/09/16/shopkick-shows-innovation-in-location-based-services-is-not-over/
== Make a new section ==
Just like this. If, for example, you want to argue about the differences between, say, Tidwell's Vertical Stack, and our general concept of the List, then add a section to discuss. If we're successful, we'll get to make a new edition and will take all these discussions into account.