SlideShare a Scribd company logo
Tim Messerschmidt
Head of Developer Relations, International
Braintree_PayPal
@Braintree_Dev / @SeraAndroid
Building a Mobile Location Aware
System with Beacons
#OSCON
@Braintree_Dev / @SeraAndroid#OSCON
A Beacon’s
Purpose
@Braintree_Dev / @SeraAndroid#OSCON
Location
Awareness
@Braintree_Dev / @SeraAndroid#OSCON
Source: http://communityhealthmaps.nlm.nih.gov/2014/07/07/how-accurate-is-the-gps-on-my-smart-phone-part-2
GPS
3m
A-GPS
8m
WiFi
75m
Cellular
600m
Leveraging Your
Phone’s Hardware
@Braintree_Dev / @SeraAndroid#OSCON
GPS vs
Bluetooth Smart
@Braintree_Dev / @SeraAndroid#OSCON
Bluetooth vs
Bluetooth Smart
@Braintree_Dev / @SeraAndroid#OSCON
Triangulation
Beacon
Beacon
Beacon
Position
Measuring
Angles From a
Fixed Location
@Braintree_Dev / @SeraAndroid#OSCON
Trilateration
Beacon
Beacon
Beacon
Position
Measuring
Distances From a
Fixed Location
@Braintree_Dev / @SeraAndroid#OSCON
Applying This to
the real world
@Braintree_Dev / @SeraAndroid#OSCON
@Braintree_Dev / @SeraAndroid#OSCON
Behind the Magic
Beacon Device
Advertisement
@Braintree_Dev / @SeraAndroid#OSCON
Behind the Magic
Beacon Device Endpoint
@Braintree_Dev / @SeraAndroid#OSCON
Popular Beacon Choices
Estimote
99 $ / 3
Gimbal
5 $
Bluecats
29 $
Kontakt.io
81 $ / 3
@Braintree_Dev / @SeraAndroid#OSCON
Advertising Beacons
UUID (16 Bytes): Large Beacon Group
Major (2 Bytes): The Beacon Subset
Minor (2 Bytes): The individual Beacon
Tx Power: translates into distance
@Braintree_Dev / @SeraAndroid#OSCON
Avoid Being creepy
@Braintree_Dev / @SeraAndroid#OSCON
Deploying Beacons
@Braintree_Dev / @SeraAndroid#OSCON
Range vs. Battery
@Braintree_Dev / @SeraAndroid#OSCON
@Braintree_Dev / @SeraAndroid#OSCON
Replacing Batteries
@Braintree_Dev / @SeraAndroid#OSCON
SiGnal Interference
@Braintree_Dev / @SeraAndroid#OSCON
Confounding Factors
Microwave ovens
Direct Satellite Services
External electrical Sources
Monitors and LCD Displays
Anything that uses 2.4 or 5 GHz
@Braintree_Dev / @SeraAndroid#OSCON
SiGnal degradation
@Braintree_Dev / @SeraAndroid#OSCON
reddit.com/r/gifs/comments/2qv6xv/visualization_of_wifi_signal_strength_in_a_room
@Braintree_Dev / @SeraAndroid#OSCON
Low Interference
Wood
Glass
Synthetic Material
Medium Interference
Water
Bricks
Marble
Very High Interference
Metal
High Interference
Plaster
Concrete
bulletproof Glass
@Braintree_Dev / @SeraAndroid#OSCON
Attaching to a Beacon
@Braintree_Dev / @SeraAndroid#OSCON
dependencies {
compile 'com.estimote:sdk:0.9.1@aar'
}
Resolving The Dependency
Source: http://github.com/Estimote/Android-SDK
@Braintree_Dev / @SeraAndroid#OSCON
getMacAddress()
getMajor()
getMinor()
getMeasuredPower()
The Estimote Beacon Object
Source: http://estimote.github.io/Android-SDK/JavaDocs/com/estimote/sdk/Beacon.html
getName()
getProximityUUID()
getRssi()
@Braintree_Dev / @SeraAndroid#OSCON
public class BeaconApplication extends Application {

private static final String ESTIMOTE_APP_ID = "FROM THE ESTIMOTE CLOUD";

private static final String ESTIMOTE_APP_TOKEN = "FROM THE ESTIMOTE CLOUD";



@Override

public void onCreate() {

super.onCreate();



EstimoteSDK.initialize(this, ESTIMOTE_APP_ID, ESTIMOTE_APP_TOKEN);

EstimoteSDK.enableDebugLogging(true);

}

}
Initializing the SDK
@Braintree_Dev / @SeraAndroid#OSCON
public class BeaconApplication extends Application implements BeaconManager.ServiceReadyCallback {

private static final String ESTIMOTE_APP_ID = "FROM THE ESTIMOTE CLOUD";

private static final String ESTIMOTE_APP_TOKEN = "FROM THE ESTIMOTE CLOUD";



private BeaconManager beaconManager;



@Override

public void onCreate() {

super.onCreate();



…



beaconManager = new BeaconManager(this);

beaconManager.connect(this);

}



@Override

public void onServiceReady() {

final Region regionOne = new Region("First region", UUID.fromString("Beacon UUID"), 22504, 44870);

beaconManager.startMonitoring(regionOne);

}

}
Monitoring a Single Beacon
@Braintree_Dev / @SeraAndroid#OSCON
public class BeaconApplication extends Application implements BeaconManager.ServiceReadyCallback {

private static final String ESTIMOTE_APP_ID = "FROM THE ESTIMOTE CLOUD";

private static final String ESTIMOTE_APP_TOKEN = "FROM THE ESTIMOTE CLOUD";



private BeaconManager beaconManager;



@Override

public void onCreate() {

super.onCreate();



…



beaconManager = new BeaconManager(this);

beaconManager.connect(this);

}



@Override

public void onServiceReady() {

final Region regionOne = new Region("First region", UUID.fromString("Beacon UUID"), null, null);

beaconManager.startMonitoring(regionOne);

}

}
Monitoring multiple BeaconS
@Braintree_Dev / @SeraAndroid#OSCON
public class BeaconApplication extends Application implements BeaconManager.ServiceReadyCallback, BeaconManager.MonitoringListener {



@Override

public void onServiceReady() {

final Region regionOne = new Region("First region", UUID.fromString("Beacon UUID"), null, null);

beaconManager.startMonitoring(regionOne);

}



@Override

public void onEnteredRegion(Region region, List<Beacon> list) {

// Interact with the region

final String regionId = region.getIdentifier();

…

}



@Override

public void onExitedRegion(Region region) {

// Notify the user that he left the region

}

}
Interacting with Regions
@Braintree_Dev / @SeraAndroid#OSCON
public class BeaconApplication extends Application implements BeaconManager.ServiceReadyCallback, BeaconManager.RangingListener {

private static final String ESTIMOTE_APP_ID = "FROM THE ESTIMOTE CLOUD";

private static final String ESTIMOTE_APP_TOKEN = "FROM THE ESTIMOTE CLOUD";



private BeaconManager beaconManager;



@Override

public void onServiceReady() {

final Region regionOne = new Region("First region", UUID.fromString("Beacon UUID"), null, null);

beaconManager.startRanging(regionOne);

}



@Override

public void onBeaconsDiscovered(Region region, List<Beacon> list) {

final Beacon closestBeacon = list.get(0);

// Interact with the beacon

}

}
Ranging Beacons
@Braintree_Dev / @SeraAndroid#OSCON
public class BeaconApplication extends Application implements BeaconConnection.ConnectionCallback, BeaconConnection.WriteCallback {



private void configureBeacon(Beacon beacon) {

final BeaconConnection connection = new BeaconConnection(this, beacon, this);

connection.authenticate();

connection.edit()

.set(connection.major(), 11)

.set(connection.minor(), 3)

.commit(this);

connection.close();

}
// Implement the two interfaces for successful authentication and writing the configuration
…
}
Configuring Beacons
@Braintree_Dev / @SeraAndroid
Distance vs Signal Strength
Source: http://developer.estimote.com/android/tutorial/part-3-ranging-beacons
0
25
50
75
100
1m 2m 4m 8m
@Braintree_Dev / @SeraAndroid#OSCON
Important: While received signal strength, proximity
zone and accuracy values can theoretically be used to
derive a distance estimation, in practice this is far
from trivial and requires complex mathematical models
to account for fluctuations in the signal strength.
Long story short: do not expect distance estimations
from beacons.
Measuring Distance
Source: http://developer.estimote.com/android/tutorial/part-3-ranging-beacons
@Braintree_Dev / @SeraAndroid#OSCON
immediate (strong signal)
near (medium signal)
far (weak signal)
unknown (very weak signal)
Measuring Distance
Source: http://developer.estimote.com/android/tutorial/part-3-ranging-beacons
@Braintree_Dev / @SeraAndroid#OSCON
immediate (strong signal) - NFC
near (medium signal) - Beacons
far (weak signal) - Beacons
unknown (very weak signal)
Measuring Distance
Source: http://developer.estimote.com/android/tutorial/part-3-ranging-beacons
@Braintree_Dev / @SeraAndroid#OSCON
computeAccuracy()
computeProximity()
isBeaconInRegion()
proximityFromAccuracy()
The Utils Class
Source: http://estimote.github.io/Android-SDK/JavaDocs/com/estimote/sdk/Utils.html
@Braintree_Dev / @SeraAndroid#OSCON
Ranging vs Monitoring
@Braintree_Dev / @SeraAndroid#OSCON
@Braintree_Dev / @SeraAndroid#OSCON
@Braintree_Dev / @SeraAndroid#OSCON
@Braintree_Dev / @SeraAndroid#OSCON
@Braintree_Dev / @SeraAndroid#OSCON
Testing BLE on Android
@Braintree_Dev / @SeraAndroid#OSCON
BLE & Android’s Emulator
Virtual Machine + USB BLE Adapter
chrislarson.me/blog/emulate-android-and-bluetooth-le-hardware.html
@Braintree_Dev / @SeraAndroid#OSCON
Altbeacon
@Braintree_Dev / @SeraAndroid#OSCON
Eddystone vs iBeacon
@Braintree_Dev / @SeraAndroid#OSCON
reference Material
Beacon vs BLE: link-labs.com/bluetooth-vs-bluetooth-low-energy
ALTBEACON: altbeacon.org
iBeacon Specification: developer.apple.com/ibeacon
Estimote JavaDoc: estimote.github.io/Android-SDK/JavaDocs
Eddystone: github.com/google/eddystone
@SeraAndroid
tim@getbraintree.com
slideshare.net/paypal
braintreepayments.com/developers
Thank you!

More Related Content

PPTX
Droid con 2015 - experimenting monitoring and proximity techniques using andr...
PDF
Experimenting Monitoring and Proximity techniques using Android potential and...
PPTX
Android location and sensors API
PPTX
Your Smart Scale Is Leaking More than Your Weight
PDF
Internet of things (IoT) Architecture Security Analysis
PDF
Getting started-with-i beacon
PPTX
IoT Labs
PDF
Analyzing the Signal Flow and RF Planning in GSM Network
Droid con 2015 - experimenting monitoring and proximity techniques using andr...
Experimenting Monitoring and Proximity techniques using Android potential and...
Android location and sensors API
Your Smart Scale Is Leaking More than Your Weight
Internet of things (IoT) Architecture Security Analysis
Getting started-with-i beacon
IoT Labs
Analyzing the Signal Flow and RF Planning in GSM Network

Viewers also liked (16)

PDF
DWS Mobile Payments Workshop
PDF
Ways to live an eco friendly lifestyle
PDF
How Datavail Built an Efficient Content Engine with Kapost
PPTX
The Ultimate Webinar Planning Guide
PDF
Node.js Authentication & Data Security
PDF
5 Things You Need to Know About Marketing-Driven Customer Experience
DOCX
Hr practice
PDF
[SlideShare] The Blueprint to B2B Content Metrics
PDF
JSConf Asia: Node.js Authentication and Data Security
PPTX
Digital marketing stratergy
PDF
X Bar Diaries social media stratergy
PDF
Silabo historia de la arquitectura
PDF
Bombardier Q400 NextGen
PPTX
Uber
PDF
Node.js Authentication and Data Security
PPT
80 років голодомору
DWS Mobile Payments Workshop
Ways to live an eco friendly lifestyle
How Datavail Built an Efficient Content Engine with Kapost
The Ultimate Webinar Planning Guide
Node.js Authentication & Data Security
5 Things You Need to Know About Marketing-Driven Customer Experience
Hr practice
[SlideShare] The Blueprint to B2B Content Metrics
JSConf Asia: Node.js Authentication and Data Security
Digital marketing stratergy
X Bar Diaries social media stratergy
Silabo historia de la arquitectura
Bombardier Q400 NextGen
Uber
Node.js Authentication and Data Security
80 років голодомору
Ad

Similar to Building a Mobile Location Aware System with Beacons (20)

PDF
Estimote beacons and simple Android application (full)
PDF
Building a Mobile Location Aware System with Beacons
PDF
AltBeacon in the IoT
PDF
Cómo Desarrollar Apps Que Interactúan Con El Mundo Real - iBeacons & BLE
PPTX
三分鐘讓你輕鬆開發 iBeacon
PPTX
Xamarin iBeacon Mini-hack using Estimote iBeacons
PDF
[CocoaHeads Tricity] Estimote Beacons - world most popular iBeacon implementa...
PDF
How to start with Estimote Beacons?
PPTX
Estimote
PDF
Bluetooth Beacon Tracking on a Budget
PPTX
Factors effecting positional accuracy of iBeacons
PDF
Location Based Development Using Xamarin
PPT
Developing context aware applications with iBeacons technology
PDF
iBeacon™ FAQ White Paper
PDF
Beacons in Appcelerator Titanium
PDF
Workshop: Building location-aware mobile apps with iBeacons
PPTX
Beacon - Revolutionizing Mobile Apps In-Context
PDF
Indoor location in mobile applications using iBeacons
PDF
Intro to iBeacon and Bluetooth Low Energy
PDF
Building Location Aware Mobile Apps with iBeacons
Estimote beacons and simple Android application (full)
Building a Mobile Location Aware System with Beacons
AltBeacon in the IoT
Cómo Desarrollar Apps Que Interactúan Con El Mundo Real - iBeacons & BLE
三分鐘讓你輕鬆開發 iBeacon
Xamarin iBeacon Mini-hack using Estimote iBeacons
[CocoaHeads Tricity] Estimote Beacons - world most popular iBeacon implementa...
How to start with Estimote Beacons?
Estimote
Bluetooth Beacon Tracking on a Budget
Factors effecting positional accuracy of iBeacons
Location Based Development Using Xamarin
Developing context aware applications with iBeacons technology
iBeacon™ FAQ White Paper
Beacons in Appcelerator Titanium
Workshop: Building location-aware mobile apps with iBeacons
Beacon - Revolutionizing Mobile Apps In-Context
Indoor location in mobile applications using iBeacons
Intro to iBeacon and Bluetooth Low Energy
Building Location Aware Mobile Apps with iBeacons
Ad

More from Tim Messerschmidt (8)

PDF
HackconEU: Hackathons are for Hackers
PDF
The Anatomy of Invisible Apps
PDF
Death to Passwords SXSW 15
PPTX
Expanding APIs beyond the Web
PPTX
Future Of Payments
PDF
Death To Passwords
PDF
Kraken at DevCon TLV
PDF
SETapp Präsentation
HackconEU: Hackathons are for Hackers
The Anatomy of Invisible Apps
Death to Passwords SXSW 15
Expanding APIs beyond the Web
Future Of Payments
Death To Passwords
Kraken at DevCon TLV
SETapp Präsentation

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Big Data Technologies - Introduction.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
cuic standard and advanced reporting.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Approach and Philosophy of On baking technology
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Machine learning based COVID-19 study performance prediction
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
KodekX | Application Modernization Development
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Big Data Technologies - Introduction.pptx
Unlocking AI with Model Context Protocol (MCP)
Network Security Unit 5.pdf for BCA BBA.
MYSQL Presentation for SQL database connectivity
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
cuic standard and advanced reporting.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Chapter 3 Spatial Domain Image Processing.pdf
Approach and Philosophy of On baking technology
Review of recent advances in non-invasive hemoglobin estimation
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Machine learning based COVID-19 study performance prediction
Reach Out and Touch Someone: Haptics and Empathic Computing
“AI and Expert System Decision Support & Business Intelligence Systems”
The Rise and Fall of 3GPP – Time for a Sabbatical?
KodekX | Application Modernization Development
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

Building a Mobile Location Aware System with Beacons