54
Building Location-Aware Mobile Apps with iBeacons Heather Downing

Building Location Aware Mobile Apps with iBeacons

Embed Size (px)

Citation preview

Building Location-Aware Mobile Apps with iBeaconsHeather Downing

About Me

I’m passionate about building great products that make people’s lives easier. I have experience developing full stack projects for small startups to Fortune 500 companies.

I grew up in California, am an avid horse archer, and completely obsessed with Lord of the Rings, Star Trek and guacamole.

Skills & expertise

ASP.NETMobile

DevelopmentSQL HTML,

CSS,JS

What is iBeacon?

iBeacon is a communication protocol developed by Apple on top of Bluetooth Low Energy (BLE) technology.

It allows developers to create mobile apps aware of location context provided by beacons.

What devices can see iBeacon broadcasts?

Apple devices running iOS 8+

Bluetooth 4.0 devices that support dual mode, which includes Android and Windows devices.

How have beacons been used?

Sports Complex Information

Shopping Rewards Experience

What is the anatomy of a beacon?

iBeacon identifier

Every iBeacon ID is 20 bytes long and is divided into three sections:

● UUID (16 bytes)

● Major number (2 bytes)

● Minor number (2 bytes)

Region monitoring

Region monitoring

Actions triggered on entering/exiting region’s range

Works no matter whether the app is running, suspended, or killed

If the app is not running when an enter/exit even comes, iOS will launch it into the background for a few seconds to handle the event

Region monitoring

Limitations

iOS limits the number of regions an app can be monitoring at once to 20

It only recognizes enter/exit events, and provides no information about which exact beacon triggered the event

It's not as responsive as ranging. Whereas ranging reports changes in beacons detected in range within seconds, monitoring's responsiveness varies as a result of using low-power scanning.

Exit event is always delayed at least 30 seconds, to avoid false positives

Ranging

Ranging

Actions triggered based on proximity to a beacon

Works only when the app is running (e.g., it's displayed on screen, or running in the background in response to a monitoring event, etc.)

It returns a list of beacons in range, together with an estimated proximity to each of them.

RangingLimitations

Power consumption is high and could have performance implications

iOS only allows background ranging for short periods of time (3 minutes)

If you’re planning to use the "location" background mode to do long-term ranging without a major user benefit (for example just to track user’s movements for your analytics—i.e., you're the beneficiary, not the user), you will most certainly have your app rejected by Apple for the App Store.

How precise are beacons?

What are the characteristics of beacon's signal?

There’s a handful of terms that will help you better understand how beacons work. Most of them describe signal characteristics and the way beacons communicate with mobile devices:

● Proximity Zones

● Broadcasting Power

● Advertising Interval

● RSSI

● Measured Power

Proximity zones

iBeacon defines four proximity zones for estimating distance to a beacon:

● Immediate (very close to the beacon)

● Near (about 1-3 m from the beacon)

● Far (further away or the signal is fluctuating too much to make an estimate)

● Unknown

Keep in mind that the zones are fixed.You cannot adjust their size or sensitivity.

Broadcasting Power (Loudness)

This directly impacts signal range. The more power, the longer the range. The value ranges depend on the manufacturer, but roughly this what you expect:

Whisper: -23 dBm

Mutter: -20 dBm

Talk: -17 dBm

Shout: -10 dBm

Scream: 0 dBm

Advertising Interval

Beacons do not broadcast constantly. They ‘blink’ instead. Advertising Interval describes the time between each blink.

The value ranges between 100 ms and 2000 ms.

Keep in mind that adjusting Advertising Interval will impact battery life in a big way.

The shorter the interval, the more stable the signal.

RSSI (Received Signal Strength Indicator)

The strength of the beacon's signal as seen on the receiving device, such as a smartphone.

The further away the device is from the beacon, the more unstable the RSSI becomes.

Due to external factors influencing radio waves—such as absorption, interference, or diffraction—RSSI tends to fluctuate.

Measured Power

Measured Power is a factory-calibrated, read-only constant which indicates what's the expected RSSI at a distance of 1 meter to the beacon.

Combined with RSSI, it allows to estimate the distance between the device and the beacon.

Does iBeacon work on Android?

YES!*Android version 4.3+

*Android device must have a Bluetooth LE chipset

*Need a third party library bundled with your app or you need to roll your own code to decode Bluetooth LE advertisements to read beacon identifiers

DEMO

Best Practices

Use them for what they do best

Use them for what they do best

Good at proximity gating

Use them for what they do best

Good at proximity gating

Don’t be overly ambitious about accuracy

Use them for what they do best

Good at proximity gating

Don’t be overly ambitious about accuracy

Best for signal strength under 25ft

Use brands that provide cloud management

Use brands that provide cloud management

Monitor battery life

Use brands that provide cloud management

Monitor battery life

Plan on the ability to swap out battery power at any time

Use brands that provide cloud management

Monitor battery life

Plan on the ability to swap out battery power at any time

Adjust signal strength remotely

Keep things simple to produce consistency

Keep things simple to produce consistency

Focus on a flow that makes sense and can be reliable and repeatable

Keep things simple to produce consistency

Focus on a flow that makes sense and can be reliable and repeatable

Consider environmental factors that can disrupt line of sight

Keep things simple to produce consistency

Focus on a flow that makes sense and can be reliable and repeatable

Consider environmental factors that can disrupt line of sight

Test in a room full of people

Questions?

Stay curious.

Heather Downing@quorralyne

[email protected]

DigitalLightCycle.blogspot.com