66
Building Location-Aware Mobile Apps with iBeacons Heather Downing

Workshop: Building location-aware mobile apps with iBeacons

Embed Size (px)

Citation preview

Page 1: Workshop: Building location-aware mobile apps with iBeacons

Building Location-Aware Mobile Apps with iBeaconsHeather Downing

Page 2: Workshop: Building location-aware mobile apps with iBeacons

Heather Downing

slideshare.net/quorralyne

github.com/quorralyne

@[email protected]

www.quorralyne.comDigitalLightCycle.blogspot.com

Page 3: Workshop: Building location-aware mobile apps with iBeacons

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.

Page 4: Workshop: Building location-aware mobile apps with iBeacons
Page 5: Workshop: Building location-aware mobile apps with iBeacons

Skills & expertise

ASP.NETMobile

DevelopmentSQL HTML,

CSS,JS

Page 6: Workshop: Building location-aware mobile apps with iBeacons

What is iBeacon?

Page 7: Workshop: Building location-aware mobile apps with iBeacons
Page 8: Workshop: Building location-aware mobile apps with iBeacons

iBeacon is an Apple trademarked transmission protocol used to communicate between Bluetooth LE beacons and any Apple device.

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

Page 9: Workshop: Building location-aware mobile apps with iBeacons

https://developer.apple.com/ibeacon/Official Site

Page 10: Workshop: Building location-aware mobile apps with iBeacons

What is Bluetooth Low Energy?

Page 11: Workshop: Building location-aware mobile apps with iBeacons
Page 12: Workshop: Building location-aware mobile apps with iBeacons
Page 13: Workshop: Building location-aware mobile apps with iBeacons

Classic Bluetooth requires pairing which drains battery life

BLE does not pair which means longer battery life

Page 14: Workshop: Building location-aware mobile apps with iBeacons
Page 15: Workshop: Building location-aware mobile apps with iBeacons
Page 16: Workshop: Building location-aware mobile apps with iBeacons

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.

Page 17: Workshop: Building location-aware mobile apps with iBeacons

How have beacons been used?

Page 19: Workshop: Building location-aware mobile apps with iBeacons

Shopping Rewards Experience

Page 20: Workshop: Building location-aware mobile apps with iBeacons
Page 21: Workshop: Building location-aware mobile apps with iBeacons

What is the anatomy of a beacon?

Page 22: Workshop: Building location-aware mobile apps with iBeacons

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)

Page 23: Workshop: Building location-aware mobile apps with iBeacons

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

Page 24: Workshop: Building location-aware mobile apps with iBeacons

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.

Page 25: Workshop: Building location-aware mobile apps with iBeacons

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.

Page 26: Workshop: Building location-aware mobile apps with iBeacons

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.

Page 27: Workshop: Building location-aware mobile apps with iBeacons

What does an iBeacon broadcast packet look like?

Page 28: Workshop: Building location-aware mobile apps with iBeacons

Region monitoring

Page 29: Workshop: Building location-aware mobile apps with iBeacons

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

Page 30: Workshop: Building location-aware mobile apps with iBeacons
Page 31: Workshop: Building location-aware mobile apps with iBeacons

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

Page 32: Workshop: Building location-aware mobile apps with iBeacons

LAB 1CLOSEST BEACON : iOS

Page 33: Workshop: Building location-aware mobile apps with iBeacons

BREAK - resume at 9am

Page 34: Workshop: Building location-aware mobile apps with iBeacons

How precise are beacons?

Page 35: Workshop: Building location-aware mobile apps with iBeacons

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

Page 36: Workshop: Building location-aware mobile apps with iBeacons

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.

Page 37: Workshop: Building location-aware mobile apps with iBeacons
Page 38: Workshop: Building location-aware mobile apps with iBeacons

Ranging

Page 39: Workshop: Building location-aware mobile apps with iBeacons

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.

Page 40: Workshop: Building location-aware mobile apps with iBeacons
Page 41: Workshop: Building location-aware mobile apps with iBeacons

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.

Page 42: Workshop: Building location-aware mobile apps with iBeacons

Does iBeacon work on Android?

Page 43: Workshop: Building location-aware mobile apps with iBeacons

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

Page 44: Workshop: Building location-aware mobile apps with iBeacons

Android Works with iBeacon

Android devices do not have a beacon system of this type at the operating-system level.

Android apps must therefore scan for BLE, meaning that for Android users to interact with beacons, they have to have the app running on their phone, at least in the background.

Beacon scanning at the app level means there is more of a battery drain for Android users.

Page 46: Workshop: Building location-aware mobile apps with iBeacons

LAB 2BEACON PROXIMITY: Android

Page 47: Workshop: Building location-aware mobile apps with iBeacons

BREAK - resume at 10am

Page 48: Workshop: Building location-aware mobile apps with iBeacons

GUEST SPEAKER:Lyndsey Padget

Page 49: Workshop: Building location-aware mobile apps with iBeacons

LAB 3STORING BEACON DATA: RESTful API

Page 50: Workshop: Building location-aware mobile apps with iBeacons

BREAK - resume at 11am

Page 51: Workshop: Building location-aware mobile apps with iBeacons

Best Practices

Page 52: Workshop: Building location-aware mobile apps with iBeacons

Use them for what they do best

Page 53: Workshop: Building location-aware mobile apps with iBeacons

Use them for what they do best

Good at proximity gating

Page 54: Workshop: Building location-aware mobile apps with iBeacons

Use them for what they do best

Good at proximity gating

Don’t be overly ambitious about accuracy

Page 55: Workshop: Building location-aware mobile apps with iBeacons

Use them for what they do best

Good at proximity gating

Don’t be overly ambitious about accuracy

Best for signal strength under 25ft

Page 56: Workshop: Building location-aware mobile apps with iBeacons

Use brands that provide cloud management

Page 57: Workshop: Building location-aware mobile apps with iBeacons

Use brands that provide cloud management

Monitor battery life

Page 58: Workshop: Building location-aware mobile apps with iBeacons

Use brands that provide cloud management

Monitor battery life

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

Page 59: Workshop: Building location-aware mobile apps with iBeacons

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

Page 60: Workshop: Building location-aware mobile apps with iBeacons

Keep things simple to produce consistency

Page 61: Workshop: Building location-aware mobile apps with iBeacons

Keep things simple to produce consistency

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

Page 62: Workshop: Building location-aware mobile apps with iBeacons

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

Page 63: Workshop: Building location-aware mobile apps with iBeacons

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

Page 64: Workshop: Building location-aware mobile apps with iBeacons

LAB 4BUILDING A SCAVENGER HUNT: iOS

Page 65: Workshop: Building location-aware mobile apps with iBeacons

Questions?

Page 66: Workshop: Building location-aware mobile apps with iBeacons

Stay curious.

slideshare.net/quorralyne

github.com/quorralyne

Heather Downing@quorralyne

[email protected]

DigitalLightCycle.blogspot.com