Nearby Notifications –
annoy your friends!
+RadoslawPiekarz
@radzio
Slide 2
Slide 2 text
No content
Slide 3
Slide 3 text
No content
Slide 4
Slide 4 text
No content
Slide 5
Slide 5 text
Agenda
History
iBeacon
Eddystone
Using Beacons before 2016
Using Beacons now
Nearby notifications
Physical Web @lukaszbyjos
Slide 6
Slide 6 text
Beacons
Slide 7
Slide 7 text
2011 2012 2013
Apple launches
iBeacon technology
Android 4.3 supports
Bluetooth 4.0
2014 2015 2016
iPhone 4S
First smartphone with
Bluetooth 4.0
Google launches
Eddystone
specifications
Physical Web support on
Google Chrome v. 49 for
Android
Nearby Notifications
Slide 8
Slide 8 text
No content
Slide 9
Slide 9 text
7.12.2016
Slide 10
Slide 10 text
More than 371 million Bluetooth enabled beacons
are projected to ship by 2020
research by ABI Research
Slide 11
Slide 11 text
iBeacon
• iBeacon protocol supports
both iOS and Android
• Beacon manufacturer need to
be vetted by Apple to be
iBeacon compliance
• iBeacon transmits simple
data fields like UUID, Major
ID, and Minor ID.
Slide 12
Slide 12 text
Eddystone
• Eddystone supported beacons can
emit three different frame type
signals
• All three frame types are supported
by both Android and iOS
• Open standard / open source
(github.com/google/eddystone)
Slide 13
Slide 13 text
Eddystone-UID
• Similar to iBeacon, the beacon
which supports Eddystone UID
needs an app to receive
designated UID for the app to
recognize
• Eddystone’s UID have 16 digit
strings to identify a beacon
uniquely, 10 character
Namespace to identify an entity
/ organization and a 6 character
Instance to identify individual
beacons
• Eddystone-EID
Slide 14
Slide 14 text
Eddystone-URL
• Eddystone URL supported beacons
does not require an app to catch the
data transmitted from it but it
requires a beacon supported browser
installed.
• Eddystone URL broadcasts a URL,
which can link to any site.
• This is basically for the “Physical
Web”, where developer can put
content which everyone can access it.
(http://google.github.io/physical-
web/)
Slide 15
Slide 15 text
Eddystone-TLM
• These beacons send Eddystone UID,
Eddystone URL and beacons health
status like battery life, diagnostic data
etc.
• These are mainly intended for
beacons fleet management and they
transmits data less frequently
compared to other two.
Slide 16
Slide 16 text
Beacons and Android before 2016
Slide 17
Slide 17 text
Scanning for beacons
BluetoothAdapter
BluetoothAdapter.LeScanCallback mLeScanCallback =
new BluetoothAdapter.LeScanCallback(){
@Override
public void onLeScan(final BluetoothDevice device, int rssi, byte[] scanRecord){
}
};
device - Identifies the remote device
rssi - The RSSI value for the remote device as reported by the Bluetooth hardware.
scanRecord - The content of the advertisement record offered by the remote device.
Slide 18
Slide 18 text
Scanning for beacons
BluetoothAdapter
BluetoothAdapter.LeScanCallback mLeScanCallback =
new BluetoothAdapter.LeScanCallback(){
@Override
public void onLeScan(final BluetoothDevice device, int rssi, byte[] scanRecord){
}
};
device - Identifies the remote device
rssi - The RSSI value for the remote device as reported by the Bluetooth hardware.
scanRecord - The content of the advertisement record offered by the remote device.
Slide 19
Slide 19 text
Battery?
=
My Super App Shopping App Public
Transport App
Beacon scanning
background service
Beacon scanning
background service
Beacon scanning
background service
Slide 20
Slide 20 text
Battery?
=
Beacon Scanning Service
My Super App Shopping App Public
Transport App
BroadcastReceiver BroadcastReceiver BroadcastReceiver
Google Play Services
Slide 21
Slide 21 text
Nearby API
googleApiClient = new GoogleApiClient.Builder(fragmentActivity)
.addApi(Nearby.MESSAGES_API)
.addConnectionCallbacks(this)
.enableAutoManage(fragmentActivity, this)
.build();
googleApiClient.connect();
Slide 22
Slide 22 text
Nearby API
SubscribeOptions options = new SubscribeOptions.Builder()
.setStrategy(Strategy.BLE_ONLY)
.build();
Nearby.Messages.subscribe(googleApiClient, getPendingIntent(), options)
.setResultCallback(new MyResultCallbacks())
Slide 23
Slide 23 text
Nearby API
private PendingIntent getPendingIntent()
{
Intent intent = new Intent(context, BeaconMessageReceiver.class);
return PendingIntent.getBroadcast(context,
REQUEST_CODE, intent, PendingIntent.FLAG_UPDATE_CURRENT);
}
Slide 24
Slide 24 text
Nearby API
public class BeaconMessageReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Nearby.Messages.handleIntent(intent, new MessageListener() {
@Override
public void onFound(Message message) {
}
@Override
public void onLost(Message message){
}
});
}
Slide 25
Slide 25 text
Nearby API
• We don’t have to deal with bluetooth runtime
permissions
• But we need to ask user to allow Nearby
Slide 26
Slide 26 text
Nearby API – beacons dashboard
Slide 27
Slide 27 text
No content
Slide 28
Slide 28 text
Nearby notifications?
Slide 29
Slide 29 text
Nearby notifications
• Get a beacon (or make one!)
Slide 30
Slide 30 text
Nearby notifications
• Get a beacon (or make one!)
• Register it in Google Beacon
Dashboard
Slide 31
Slide 31 text
Nearby notifications
• Get a beacon (or make one!)
• Register it in Google Beacon
Dashboard
• Configure notifications
Slide 32
Slide 32 text
No content
Slide 33
Slide 33 text
Nearby notifications ( Kraków & JakDojade.pl)
Slide 34
Slide 34 text
Nearby notifications
Slide 35
Slide 35 text
Takeaways #1
• Only https:// addresses are supported
• Scan is performed only when screen is turning on
• App intents are currently available only for Google Partners
Slide 36
Slide 36 text
Takeaways #1
• Only https:// addresses are supported
• Scan is performed only when screen is turning on
• App intents are currently available only for Google Partners
• App intent are available for anyone!
Slide 37
Slide 37 text
Physical Web
Slide 38
Slide 38 text
Physical Web
• Open standard that everyone can use
• No proactive notifications
• Open Source
• BLE energy efficient & widespread
• Built on web and urls
• Can use mDNS too
• Context is the king
• Connect digital and real world
• Use Eddystone URL beacons
• Supported by Chrome for Android, Opera for Android
Slide 39
Slide 39 text
Physical Web
Slide 40
Slide 40 text
Takeaways #2
• With great power comes great resposibility
• Nearby API is easy and energy efficient
• Nearby Notifications are the most easy way to start using Beacons on
Android