Introduction - Building Applications with iBeacon (2015)

Building Applications with iBeacon (2015)

Chapter 1. Introduction

Close don’t count in baseball. Close only counts in horseshoes and hand grenades.

Frank Robinson

Close doesn’t always count when building mobile applications. Mobile devices typically have smaller screens and might have limited forms of text input. But the user profile of a device is not the major constraint on its function. At its best, an application that knows where you are will augment reality to help you navigate and interact with the physical world.

We have seen some tentative steps toward applications that interact with the world around them. Star maps use location information and accelerometer-derived tilt readings to highlight stars in the sky on a real-time picture from a phone’s camera.1 Inexpensive GPS receivers have turned every smartphone into an up-to-date navigation system for drivers, turning archaic practices such as knowing how to fold a paper map or memorizing how to get around a city2 into stories that we will someday scare children with.

Until now, no technology has enabled you to interact with the world within “arm’s reach.” That has changed with the introduction of Bluetooth proximity beacons, often referred to as iBeacons.3 Beacons bridge the gap between the data world of ones, zeros, and the glass screen on a mobile device and the physical world that users move through with their devices. By transmitting an identifier, a beacon can define a small area that devices react to, and those reactions can be used to create new applications and new interactions.

An iBeacon is a Bluetooth Low Energy proximity beacon that is submitted for compatibility testing under an Apple licensing program, and the Bluetooth proximity functions on Apple systems are referred to in developer documentation as iBeacon frameworks.

Much of the enthusiasm for these new applications comes from building systems for retailers, but the simple beacon protocol can be applied to many types of spaces, leading to varied applications as diverse as indoor direction finding, queue management, museum guides, and restaurant management.

Why iBeacons?

There are two interrelated reasons for the excitement around iBeacons. Most importantly, the technology enables a device to make extremely precise determinations of what is nearby. Even under ideal conditions, GPS technologies struggle to do better than a few meters, and GPS is often limited indoors. iBeacons can enable a determination within centimeters.

Equally as important, the high-precision location information is readily available to applications, which enables developers to create new types of experiences by incorporating this information into applications.

NOTE

iBeacons offer high precision micro-location, along with the ability to act on what a mobile device is near. No other technology yet offers that combination.

Location Versus Proximity

iBeacons define “what you are close to,” which is often related to “where you are,” but not necessarily. Many people use the terms location and proximity interchangeably. Though the words are related, they have subtle differences that make them distinct concepts.

Most importantly, location is an absolute, unchanging concept, typically defined by some form of a coordinate system. Whether you define it as geographical coordinates such as latitude and longitude, a street address, or even much larger distance scales such as a city, state, province, or country, a location is a fixed point or area of space. Many technologies can help you answer the question of “What is my location?” One of the most common ways to answer that question is to use GPS or cell tower mapping, and the resulting location often has the precision of a building or a street address. With this form of location, you can drive or walk to a building, find nearby events or restaurants, or check in for your visit.4

In contrast to the absolute of location, proximity is the answer to the question “What is nearby?” Rather than an absolute location, proximity is defined in relation to some other point.5 Conceptually, proximity is a distance, and has no direction. Am I near another person? A particular display in a store? The conductor on the train?

Part of the confusion comes from the fact that proximity technologies can be used to provide location information. If a proximity network is installed in an indoor location where GPS does not work well, the reference points used by the proximity system may be used to help an application infer a location. That is, the proximity system knows that you are a given distance from three proximity points with known locations and, therefore, you are standing near baggage claim carousel 5.

When used in this manner, proximity technologies are said to be providing micro-location, because they can provide much more accurate information than GPS, especially in buildings where GPS does not operate with high accuracy (or possibly even at all). In a micro-location scenario, proximity can operate as a tighter description of where you are, but that misstates the power of proximity.

iBeacons are exciting because they can do more than provide location information. Proximity is based on “what is near you” instead of “where you are.” As a result, an application can tell whether you are near an item of interest, regardless of its location.

For example, if you are visiting the Louvre, you might care whether you are near the Venus de Milo or Canova’s Cupid’s Kiss, regardless of the location of those artworks in the galleries. Using proximity technology means that an electronic museum guide knows what is near by knowing proximity information, rather than the more complicated process of the museum guide knowing where it is and where displays are and calculating proximity based on comparing the two points.

Proximity enables an application to identify something of interest based on what it is near, and that is often independent of location. As an example, consider a train passenger. The passenger’s location is constantly changing as the train moves along the tracks, but an application that holds a ticket does not care about location. In contrast, it might be interested in knowing only when a conductor is nearby, so that it can display an electronic ticket.

Proximity services are based on a different set of technologies than location services. Rather than being large outdoor systems like cell networks or satellites, proximity is based on shorter-range technologies like Wi-Fi or Bluetooth Low Energy (the BLE-based iBeacon, for instance). Table 1-1 illustrates some of these key differences.

Location

Proximity

GPS, Wi-Fi

iBeacon, Bluetooth, Wi-Fi Time Difference of Arrival (TDOA)

Driving directions

In-building directions

10s or 100s of meters6

Centimeters to meters

Table 1-1. Differences between location and proximity

An important technical difference between the two classes of technology is that proximity technologies can be used indoors to provide the same types of services as large outdoor systems but on a smaller scale.

Interactivity

iBeacons define small regions in space, based on how far their signals move through space. The beacon transmissions can trigger a mobile device to take action at a precise location, typically through an application.

Rather than depend on a user to locate himself on a map, or press buttons, or select from a menu of actions, applications can now be triggered by the physical world.

Applications

The most important difference between proximity and location is that the smaller scale of proximity drives closer interaction between customers and a business. Although the technology is most discussed in retail, it is potentially useful in a wide variety of contexts.

Broadly speaking, applications use proximity technologies to improve location awareness in areas where technologies traditionally have not supported a fine-grained location. When iBeacons are used, they provide proximity information to enable the application, though, as we will see, the iBeacon provides a trigger to the application and works in conjunction with a companion web service.

Indoor Location and Proximity

The go-to technologies used for location, GPS and Wi-Fi, are not useful for indoor direction finding. That is, they provide location services, but not proximity. Possible applications for indoor proximity include:

Map replacement

Within a large building, it can be difficult to find your way around without extensive maps. Large hospitals often are a challenge to navigate, as are malls. In both types of locations, a series of beacons can help a device accurately place itself on a map and augment reality by providing clear directions to a destination. Electronic maps have the additional advantage of being able to update electronically and instantaneously in response to changes in the physical location of departments, stores, or other points of interest.

Transit assistance

Transit hubs such as airports and train stations can be confusing for infrequent travelers. (Navigating Shinjuku Station in Tokyo or Penn Station in New York City can be challenging for even highly experienced travelers.) Applications can already access ticketing information and use that to automatically assist travelers in finding a boarding gate, ending with calling up the relevant ticket at the end of the journey.

Indoor direction finding

In heavily built-up cities, directions will often include a subway or train station exit to take for the optimal path to a destination. Both the Hong Kong and Tokyo subways use clearly identified exits with examples of major landmarks. By using proximity technology indoors, direction-finding apps could incorporate instructions to train riders to find the correct exit, even deep below ground.

Where is my car?

This is a special case of indoor direction finding. In massive parking garages, it can be difficult to remember where you parked your car. GPS is often limited in parking structures given the robust construction needed to handle the weight of vehicles. Instead of the mobile device giving you directions to a fixed point, it can guide you directly to your parking spot.

Museum guides

Instead of printed paper guidebooks, museums can build apps for patrons. In addition to direction finding, major exhibits can have extended information available, allowing visitors to engage more deeply with major exhibitions than a few signs would allow. One of my favorite museum guides is at the Musée de la Musique in Paris, where an audio guidebook enables visitors to hear many of the musical instruments in the collection being played.

Retail store enhancement

I’ve placed this item last on the list because it is the most obvious and likely to be familiar even without reading this book. Proximity allows a mobile device to take the display you are standing in front of into account, rather than just mere presence in the store. One of the earliest applications of beacons in retail is the official Apple Store app for iOS, which will welcome you to an Apple store and offer assistance with items you are standing in front of. By further developing this channel, it is possible to monitor shoppers through the store and offer promotions based on purchase history.

iBeacons are about much more than indoor locations. In addition to offering information about where a device is to help the user, the proximity of a device to a given location can also be used to trigger an action on the device.

Proximity-Triggered Actions

Location technologies can provide a position that is accurate to within a building, but some applications might benefit from even more accurate position information. Proximity enables actions to be taken when two devices are close to each other. Typically, this is discussed as a mobile device moving through space, but it might also be two mobile devices moving relative to each other.

Here are some examples of possible actions triggered by proximity:

Mobile advertisements

Proximity is discussed so frequently with mobile ads that the two seem inextricably linked sometimes. When a device gets close to a display, an advertisement can be pushed to the display. The display might be a coupon, notification of a sale, or simply an offer to receive more information.

Ticket validation

On many trains, conductors are required to validate tickets, and one of my favorite developments in recent years is the use of easily integrated mobile ticketing services that allow me to carry tickets electronically and update them seamlessly. If the train conductor’s equipment signals that the conductor is coming, the proximity of a passenger’s mobile device to the train conductor can be used to display the ticket.

Treasure hunt

At CES in 2014, an app rewarded users who went around the show floor to collect “virtual stamps.” After getting near all nine virtual locations, users could then take the completed virtual card to the show office for a reward.7

Patient information integration

Relentless checking and rechecking of treatment orders is a practical approach to reducing medical errors. Low-energy Bluetooth hardware is inexpensive enough that iBeacons on patient ID bands can be used to automatically pull up records on a doctor’s tablet and confirm that patients are being treated appropriately.

Triggering actions based on proximity can bring devices into your business processes. One of the most common business processes to integrate users into is some sort of queue management, because many organizations have their customers use a line of some sort.

Queue Management

Many people now carry mobile devices with them as they move throughout their day, and the ability to interact with mobile devices enables many organizations to manage queues of customers more effectively in the following ways:

Queue measurement

By placing proximity beacons at the start and end of a queue, businesses can measure how long a typical transaction takes and can even expose that information to other customers. The California DMV, for example, regularly publishes queue times at different DMV offices (though they gather the information through methods other than beacons). Bank teller queues or airport security queues are often of great interest to customers.

Restaurant table pager

Restaurants often use wireless devices to signal you that your table is ready. The existing devices are pagers and therefore have limited communication abilities. By using proximity technologies, an app running on a phone can “check in” to a queue for a table and potentially signal the restaurant to alert the patron when a table is ready. In this case, beacon technology is used to trigger the start of the interaction, but other data networks are required to complete it.

Transaction completion in retail

Quick-service restaurants are managed for turnaround time. By using beacons, they can trigger an app to wake up and pay for a transaction automatically using a payment system such as PayPal or Square. Or if a restaurant allows patrons to order hot food, the act of walking into a restaurant can trigger the kitchen to start making an order.

Many other types of queue management exist, of course, and one of the advantages of building queue management with iBeacons is that the location of the queue entry point can move easily without reprogramming the application.

Bluetooth Low Energy Beacons

The key technology that enables the iBeacon is the proximity specification in Bluetooth Low Energy (BLE), which is often called Bluetooth Smart.8 BLE is an enhancement of the existing Bluetooth specification designed for even lower-power operation. BLE beacons transmit identification information that applications can use to identify the type of space the beacon is installed in. Devices branded as “Bluetooth Smart Ready” are dual-mode devices that can interoperate with both classic Bluetooth as well as BLE.

iBeacons are a subset of the BLE beacon specification. Figure 1-1 illustrates the relationship between iBeacons, generic beacons, BLE beacons, and BLE devices. All iBeacons are BLE beacons, and all BLE beacons are BLE devices. However, there are beacons that are not Bluetooth-based, and there are BLE devices that do not beacon. This book concentrates on the overlap of all these categories, with minor notes where the iBeacon specification differs from generic BLE beacons.

Beacon Venn Diagram

Figure 1-1. The relationship between iBeacons, BLE, and beacons

At low transmit power, the energy consumption of a beacon is quite low. Beacons can run for extended periods of time on battery power, with vendors claiming battery life of months or even years. Many proximity applications are designed to be triggered within a few feet of the target area and, in practice, that will require battery operation. In retail stores, for example, many displays will not have ready access to electrical power. Many early hardware products support limited battery lifetimes of a few weeks or months, so permanent displays will require full-time power.

Beacons also do not require Internet access to function. The protocol is simple and straightforward and can be embedded within an application so that it can run without continuous Internet connectivity. Note, however, that although iBeacons do not require connectivity to function, the applications they enable typically do require connectivity to the device.

1 Reading the tilt of a phone is a complex process that involves multiple sensors. Accelerometers measure the orientation of the phone relative to gravity, and gyroscopes provide a rate of change in the angles of the device around its axis. Multiple sensors can be combined in software (a process called sensor fusion), blending inputs from GPS, magnetic fields, acceleration, gyroscopes, and even barometric pressure.

2 The most famous test of navigation skill and geographic awareness is “The Knowledge,” required of every London cab driver.

3 Particularly astute readers may be asking why we need proximity beacons if a typical phone has multiple sensors. The answer, as pointed out by one of my reviewers, is that the typical gyroscopes used in mobile devices are too noisy to perform high-quality navigation functions; hence, beacons are required to overcome the limitations of existing sensor technology.

4 With all the technology development that has occurred in my career, it is sometimes hard for me to remember that when I first moved to Silicon Valley, I found an apartment by getting a daily list faxed to me and looking up street addresses on paper maps using the index of street names!

5 In more formal language, location has vector attributes, because it includes direction. Proximity is a scalar, because it has no direction.

6 When used outdoors, most mobile GPS devices have accuracy on the order of 10–15 meters, with substantially less accurate indoor resolution.

7 For a striking but less uplifting application of the same sort of proximity information, in April 2014, New York City’s New Museum simulated a minefield using iBeacons.

8 For much more detail and information on Bluetooth Low Energy and its definition in the Bluetooth specification, see Getting Started with Bluetooth Low Energy by Townsend et al. (O’Reilly).