SlideShare a Scribd company logo
1 of 69
Download to read offline
Eddystone Beacons Demo
Lecture on Eddystone, an open Bluetooth Smart Beacon format
from Google
+Angelo Rüggeberg
@s3xy4ngyc
agenda
- Introductions to Beacons
- Introduction to Eddystone
- Coding Session
Introduction to Beacons
Image: Google
Context or
exact Location
Location, Accuracy,
Range, and alike
Image: Google
…
Use Cases
Image: Estimote
Opportunities
Presence (e.g. sights)
Image: Google
Opportunities
Tracking and Securing
Image: Google
Opportunities
• Contextual fencing
(aka Geo-fence)
• Contextual content
(e.g. reader circle)
• …
Image: Bundesarchiv
Landscape
• AltBeacon
• Apple‘s property: iBeacon™
• Estimote
• Gimbal™
• PayPal™ Beacon
• yoints
• …
• Bluetooth® SIG
(Special Interest Group)
• Bluetooth® Smart Beacon
• Eddystone™
• https://github.
com/google/eddystone/tree/mast
er/branding
Introduction to Eddystone
Eddystone™, what’s so special?
Openness
• It is an open Bluetooth 4.0 protocol
• While iBeacon™ is officially
supported by iOS devices only,
Eddystone™ has official support
for both iOS and Android
Packet types / frames
• Eddystone-UID (identifier)
• Namespace as UUID
• Instance (6 bytes), much like Major
and Minor
• Eddystone-URL
• Eddystone-TLM (telemetry)
• battery voltage
• temperature
• number of packets since last reboot
• beacon uptime since last reboot
Hardware
Phones can become Smart Beacons
themselves
• TxEddystone-UID (Android Lollipop 5.0)
Almost all devices with BLE can
become Smart Beacons themselves
• BlueGiga BLED112 Dongle
• Cambridge Silicon Radio CSR1010 (Beacon
Development Board)
• Rfduino
• Linux (bluez)
• ARM mbed (Nordic nRF51-dongle, nRF51-DK)
• Node.js (node-eddystone-beacon using
bleno)
• Arduino (BLEPeripheral), using Nordic
Semiconductor's nRF8001 or nR51822
https://github.
com/google/eddystone/tree/master/eddyst
one-uid/tools/txeddystone-uid
Some Bluetooth® Facts
• Bluetooth / BLE
is a wireless protocol
• Bluetooth uses UHF radio waves in
the ISM band from 2.4 to
2.485 GHz divided into channels
with frequency hopping
• Signal strength is an indicator for
proximity (RSSI, received signal
strength indicator)
• BLE has reduced power
consumption
• Bluetooth SIG predicts more than
90% of Bluetooth-enabled
smartphones will support the low
energy standard by 2018.
Coding a Simple BLE Scanner
Prerequisites
• Real device with BLE (emulator has
no Bluetooth™ support)
• Alternative emulator http:
//stackoverflow.
com/questions/20348743/blue
tooth-low-energy-on-android-
emulator/27712017
• Android 4.3 (Jelly Bean, API Level
18)
• Android 4.4.4 (KitKat, API Level
19) fixes some issues (e.g.
https://code.google.
com/p/android/issues/detail?
id=67272)
• Android 5.0 (Lollipop, API Level
21) recommended due to some
API changes (e.g.
Advertisement and LE Scanner)
BLE Permissions for an App
•
<!– Allow any Bluetooth communication -->
<uses-permission android:name="android.permission.BLUETOOTH"/>
<!– Allow device discovery -->
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
•
<uses-feature
android:name="android.hardware.bluetooth_le"
android:required="true“
/>
•
•
•
•
•
•
public class MainActivity extends AppCompatActivity {
// Declare Bluetooth adapter
private BluetoothManager bluetoothManager;
private BluetoothAdapter bluetoothAdapter;
public class MainActivity extends AppCompatActivity {
// Declare Bluetooth adapter
private BluetoothManager bluetoothManager;
private BluetoothAdapter bluetoothAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Initialize Bluetooth adapter
bluetoothManager = (BluetoothManager) getSystemService(Context.
BLUETOOTH_SERVICE);
bluetoothAdapter = bluetoothManager.getAdapter();
…
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Initialize Bluetooth adapter
bluetoothManager = (BluetoothManager) getSystemService(Context.
BLUETOOTH_SERVICE);
bluetoothAdapter = bluetoothManager.getAdapter();
…
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Initialize Bluetooth adapter
bluetoothManager = (BluetoothManager) getSystemService(Context.
BLUETOOTH_SERVICE);
bluetoothAdapter = bluetoothManager.getAdapter();
…
bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() {
@Override
public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) {
Log.d(TAG, "Device-Adress: " + device.getAddress());
Log.d(TAG, "RSSI: " + rssi);
}
});
bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() {
@Override
public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) {
Log.d(TAG, "Device-Adress: " + device.getAddress());
Log.d(TAG, "RSSI: " + rssi);
}
});
bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() {
@Override
public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) {
Log.d(TAG, "Device-Adress: " + device.getAddress());
Log.d(TAG, "RSSI: " + rssi);
}
});
bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() {
@Override
public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) {
Log.d(TAG, "Device-Adress: " + device.getAddress());
Log.d(TAG, "RSSI: " + rssi);
}
});
bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() {
@Override
public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) {
if(device.getAddress().equals("C1:4F:F1:FF:9B:90")) {
Log.d(TAG, "Device-Adress: " + device.getAddress());
Log.d(TAG, "RSSI: " + rssi);
}
}
});
bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() {
@Override
public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) {
if(device.getAddress().equals("C1:4F:F1:FF:9B:90")) {
Log.d(TAG, "Device-Adress: " + device.getAddress());
Log.d(TAG, "RSSI: " + rssi);
}
}
});
Move away from deprecated Methods
bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner();
bluetoothLeScanner.startScan(new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
}
@Override
public void onBatchScanResults(List<ScanResult> results) {
super.onBatchScanResults(results);
}
});
bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner();
bluetoothLeScanner.startScan(new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
}
@Override
public void onBatchScanResults(List<ScanResult> results) {
super.onBatchScanResults(results);
}
});
bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner();
bluetoothLeScanner.startScan(new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
}
@Override
public void onBatchScanResults(List<ScanResult> results) {
super.onBatchScanResults(results);
}
});
bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner();
bluetoothLeScanner.startScan(new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
}
@Override
public void onBatchScanResults(List<ScanResult> results) {
super.onBatchScanResults(results);
}
});
bluetoothLeScanner.startScan(filters, settings, new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
}
});
bluetoothLeScanner.startScan(filters, settings, new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
}
});
ScanSettings settings = new ScanSettings.Builder()
.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
.build();
List<ScanFilter> filters = new ArrayList<>();
ScanFilter filter = new ScanFilter.Builder()
.setDeviceAddress("C1:4F:F1:FF:9B:90")
.build();
filters.add(filter);
ScanSettings settings = new ScanSettings.Builder()
.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
.build();
List<ScanFilter> filters = new ArrayList<>();
ScanFilter filter = new ScanFilter.Builder()
.setDeviceAddress("C1:4F:F1:FF:9B:90")
.build();
filters.add(filter);
ScanSettings settings = new ScanSettings.Builder()
.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
.build();
List<ScanFilter> filters = new ArrayList<>();
ScanFilter filter = new ScanFilter.Builder()
.setDeviceAddress("C1:4F:F1:FF:9B:90")
.build();
filters.add(filter);
ScanSettings settings = new ScanSettings.Builder()
.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
.build();
List<ScanFilter> filters = new ArrayList<>();
ScanFilter filter = new ScanFilter.Builder()
.setDeviceAddress("C1:4F:F1:FF:9B:90")
.build();
filters.add(filter);
ScanSettings settings = new ScanSettings.Builder()
.setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY)
.build();
List<ScanFilter> filters = new ArrayList<>();
ScanFilter filter = new ScanFilter.Builder()
.setDeviceAddress("C1:4F:F1:FF:9B:90")
.build();
filters.add(filter);
Coding Proximity and Presence
There is only one packet format for BLE
which
Payload consists of 2 Bytes Header, 6
Bytes Mac Address and up to 31 Bytes
data.
Image: Google
Fixed: 02 01 06 03 03 aa fe
Length: 15
Fixed: 16 aa fe
Frame Type: 00
TX Power: ed
Namespace: ed d1 eb ea c0 4e 5d ef a0 17
Instance: c5 61 2a 8c c2 53
... 04 09
... 45 53 54 03 03
Bat. Service: 0f 18 0e
... 16 0a 18
Mac: 53 c2 8c 2a 61 c5
... 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Fixed: 02 01 06 03 03 aa fe
Length: 11
Fixed: 16 aa fe
Frame Type: 20
Version: 00
Volt: 0c 06
Temo: 13 00
Adv. Count: 00 0f 70 77
Sec. Count: 00 14 4e 70
... 04 09
... 45 53 54 03 03
Bat. Service: 0f 18 0e
... 16 0a 18
Mac: 53 c2 8c 2a 61 c5
... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
// The Eddystone Service UUID, 0xFEAA.
private static final ParcelUuid EDDYSTONE_SERVICE_UUID
= ParcelUuid.fromString("0000FEAA-0000-1000-8000-
00805F9B34FB");
// Eddystone frame types
private static final byte TYPE_UID = 0x00;
private static final byte TYPE_URL = 0x10;
private static final byte TYPE_TLM = 0x20;
// The Eddystone Service UUID, 0xFEAA.
private static final ParcelUuid EDDYSTONE_SERVICE_UUID
= ParcelUuid.fromString("0000FEAA-0000-1000-8000-
00805F9B34FB");
// Eddystone frame types
private static final byte TYPE_UID = 0x00;
private static final byte TYPE_URL = 0x10;
private static final byte TYPE_TLM = 0x20;
// The Eddystone Service UUID, 0xFEAA.
private static final ParcelUuid EDDYSTONE_SERVICE_UUID
= ParcelUuid.fromString("0000FEAA-0000-1000-8000-
00805F9B34FB");
// Eddystone frame types
private static final byte TYPE_UID = 0x00;
private static final byte TYPE_URL = 0x10;
private static final byte TYPE_TLM = 0x20;
// The Eddystone Service UUID, 0xFEAA.
private static final ParcelUuid EDDYSTONE_SERVICE_UUID
= ParcelUuid.fromString("0000FEAA-0000-1000-8000-
00805F9B34FB");
// Eddystone frame types
private static final byte TYPE_UID = 0x00;
private static final byte TYPE_URL = 0x10;
private static final byte TYPE_TLM = 0x20;
// The Eddystone Service UUID, 0xFEAA.
private static final ParcelUuid EDDYSTONE_SERVICE_UUID
= ParcelUuid.fromString("0000FEAA-0000-1000-8000-
00805F9B34FB");
// Eddystone frame types
private static final byte TYPE_UID = 0x00;
private static final byte TYPE_URL = 0x10;
private static final byte TYPE_TLM = 0x20;
•
•
Image: Estimote
bluetoothLeScanner.startScan(filters, settings, new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID);
byte frameType = data[0];
if (frameType != TYPE_TLM) {
return;
}
// Beacon temperature
double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() /
256.0;
Log.d(TAG, String.format("%.2f°C", temp));
}
});
bluetoothLeScanner.startScan(filters, settings, new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID);
byte frameType = data[0];
if (frameType != TYPE_TLM) {
return;
}
// Beacon temperature
double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() /
256.0;
Log.d(TAG, String.format("%.2f°C", temp));
}
});
bluetoothLeScanner.startScan(filters, settings, new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID);
byte frameType = data[0];
if (frameType != TYPE_TLM) {
return;
}
// Beacon temperature
double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() /
256.0;
Log.d(TAG, String.format("%.2f°C", temp));
}
});
bluetoothLeScanner.startScan(filters, settings, new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID);
byte frameType = data[0];
if (frameType != TYPE_TLM) {
return;
}
// Beacon temperature
double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() /
256.0;
Log.d(TAG, String.format("%.2f°C", temp));
}
});
Fixed: 02 01 06 03 03 aa fe
Length: 11
Fixed: 16 aa fe
Frame Type: 20
Version: 00
Volt: 0c 06
Temo: 13 00
Adv. Count: 00 0f 70 77
Sec. Count: 00 14 4e 70
... 04 09
... 45 53 54 03 03
Bat. Service: 0f 18 0e
... 16 0a 18
Mac: 53 c2 8c 2a 61 c5
... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
bluetoothLeScanner.startScan(filters, settings, new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID);
byte frameType = data[0];
if (frameType != TYPE_TLM) {
return;
}
// Beacon temperature
double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() /
256.0;
Log.d(TAG, String.format("%.2f°C", temp));
}
});
bluetoothLeScanner.startScan(filters, settings, new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID);
byte frameType = data[0];
if (frameType != TYPE_TLM) {
return;
}
// Beacon temperature
double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() /
256.0;
Log.d(TAG, String.format("%.2f°C", temp));
}
});
bluetoothLeScanner.startScan(filters, settings, new ScanCallback() {
@Override
public void onScanResult(int callbackType, ScanResult result) {
super.onScanResult(callbackType, result);
byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID);
byte frameType = data[0];
if (frameType != TYPE_TLM) {
return;
}
// Beacon temperature
double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() /
256.0;
Log.d(TAG, String.format("%.2f°C", temp));
}
});
Outlook and helpers
,
etc.
http://on.google.com/hub/
•
•
• …
•
•
•
•
• …
Image: https://commons.wikimedia.org/wiki/File:Zinkh%C3%BCtter_Hof_Messing_Werkzeuge.jpg

More Related Content

What's hot

Droidcon2013 android experience lahoda
Droidcon2013 android experience lahodaDroidcon2013 android experience lahoda
Droidcon2013 android experience lahodaDroidcon Berlin
 
Improving android experience for both users and developers
Improving android experience for both users and developersImproving android experience for both users and developers
Improving android experience for both users and developersPavel Lahoda
 
Google I/O 2021 Recap
Google I/O 2021 RecapGoogle I/O 2021 Recap
Google I/O 2021 Recapfurusin
 
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Webbeyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than WebHeiko Behrens
 
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseEclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseHeiko Behrens
 
Getting physical with web bluetooth in the browser hackference
Getting physical with web bluetooth in the browser hackferenceGetting physical with web bluetooth in the browser hackference
Getting physical with web bluetooth in the browser hackferenceDan Jenkins
 
Getting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browserGetting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browserDan Jenkins
 
Getting Physical with Web Bluetooth in the Browser Full Stack Toronto
Getting Physical with Web Bluetooth in the Browser Full Stack TorontoGetting Physical with Web Bluetooth in the Browser Full Stack Toronto
Getting Physical with Web Bluetooth in the Browser Full Stack TorontoDan Jenkins
 
MDSD for iPhone and Android
MDSD for iPhone and AndroidMDSD for iPhone and Android
MDSD for iPhone and AndroidHeiko Behrens
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Ontico
 
Advancing the UI — Part 1: Look, Motion, and Gestures
Advancing the UI — Part 1: Look, Motion, and GesturesAdvancing the UI — Part 1: Look, Motion, and Gestures
Advancing the UI — Part 1: Look, Motion, and GesturesSamsung Developers
 
Adopting 3D Touch in your apps
Adopting 3D Touch in your appsAdopting 3D Touch in your apps
Adopting 3D Touch in your appsJuan C Catalan
 
Demystifying Android's Bluetooth Low Energy at MCE^3 Conf
Demystifying Android's Bluetooth Low Energy at MCE^3 ConfDemystifying Android's Bluetooth Low Energy at MCE^3 Conf
Demystifying Android's Bluetooth Low Energy at MCE^3 ConfPawel Urban
 
MCE^3 - Dariusz Seweryn, Paweł Urban - Demystifying Android's Bluetooth Low ...
MCE^3 - Dariusz Seweryn, Paweł Urban -  Demystifying Android's Bluetooth Low ...MCE^3 - Dariusz Seweryn, Paweł Urban -  Demystifying Android's Bluetooth Low ...
MCE^3 - Dariusz Seweryn, Paweł Urban - Demystifying Android's Bluetooth Low ...PROIDEA
 
Unbreakable: The Craft of Code
Unbreakable: The Craft of CodeUnbreakable: The Craft of Code
Unbreakable: The Craft of CodeJoe Morgan
 
Performance #1: Memory
Performance #1: MemoryPerformance #1: Memory
Performance #1: MemoryYonatan Levin
 
Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...
Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...
Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...Lviv Startup Club
 

What's hot (20)

Droidcon2013 android experience lahoda
Droidcon2013 android experience lahodaDroidcon2013 android experience lahoda
Droidcon2013 android experience lahoda
 
Improving android experience for both users and developers
Improving android experience for both users and developersImproving android experience for both users and developers
Improving android experience for both users and developers
 
Google I/O 2021 Recap
Google I/O 2021 RecapGoogle I/O 2021 Recap
Google I/O 2021 Recap
 
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Webbeyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
beyond tellerrand: Mobile Apps with JavaScript – There's More Than Web
 
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with EclipseEclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
 
Introduction to android
Introduction to androidIntroduction to android
Introduction to android
 
Getting physical with web bluetooth in the browser hackference
Getting physical with web bluetooth in the browser hackferenceGetting physical with web bluetooth in the browser hackference
Getting physical with web bluetooth in the browser hackference
 
Getting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browserGetting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browser
 
Getting Physical with Web Bluetooth in the Browser Full Stack Toronto
Getting Physical with Web Bluetooth in the Browser Full Stack TorontoGetting Physical with Web Bluetooth in the Browser Full Stack Toronto
Getting Physical with Web Bluetooth in the Browser Full Stack Toronto
 
MDSD for iPhone and Android
MDSD for iPhone and AndroidMDSD for iPhone and Android
MDSD for iPhone and Android
 
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
Паразитируем на React-экосистеме (Angular 4+) / Алексей Охрименко (IPONWEB)
 
Advancing the UI — Part 1: Look, Motion, and Gestures
Advancing the UI — Part 1: Look, Motion, and GesturesAdvancing the UI — Part 1: Look, Motion, and Gestures
Advancing the UI — Part 1: Look, Motion, and Gestures
 
Introduction toandroid
Introduction toandroidIntroduction toandroid
Introduction toandroid
 
Adopting 3D Touch in your apps
Adopting 3D Touch in your appsAdopting 3D Touch in your apps
Adopting 3D Touch in your apps
 
Demystifying Android's Bluetooth Low Energy at MCE^3 Conf
Demystifying Android's Bluetooth Low Energy at MCE^3 ConfDemystifying Android's Bluetooth Low Energy at MCE^3 Conf
Demystifying Android's Bluetooth Low Energy at MCE^3 Conf
 
MCE^3 - Dariusz Seweryn, Paweł Urban - Demystifying Android's Bluetooth Low ...
MCE^3 - Dariusz Seweryn, Paweł Urban -  Demystifying Android's Bluetooth Low ...MCE^3 - Dariusz Seweryn, Paweł Urban -  Demystifying Android's Bluetooth Low ...
MCE^3 - Dariusz Seweryn, Paweł Urban - Demystifying Android's Bluetooth Low ...
 
Unbreakable: The Craft of Code
Unbreakable: The Craft of CodeUnbreakable: The Craft of Code
Unbreakable: The Craft of Code
 
Performance #1: Memory
Performance #1: MemoryPerformance #1: Memory
Performance #1: Memory
 
From newbie to ...
From newbie to ...From newbie to ...
From newbie to ...
 
Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...
Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...
Lviv MDDay 2014. Ігор Коробка “забезпечення базової безпеки в андроїд аплікац...
 

Similar to Eddystone beacons demo

A brief overview of BLE on Android
A brief overview of BLE on AndroidA brief overview of BLE on Android
A brief overview of BLE on AndroidLuka Bašek
 
What's new in android jakarta gdg (2015-08-26)
What's new in android   jakarta gdg (2015-08-26)What's new in android   jakarta gdg (2015-08-26)
What's new in android jakarta gdg (2015-08-26)Google
 
Modeveast Appcelerator Presentation
Modeveast Appcelerator PresentationModeveast Appcelerator Presentation
Modeveast Appcelerator PresentationAaron Saunders
 
Building Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsBuilding Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsHassan Abid
 
Fiware IoT Proposal & Community
Fiware IoT Proposal & Community Fiware IoT Proposal & Community
Fiware IoT Proposal & Community TIDChile
 
Apps development for Recon HUDs
Apps development for Recon HUDsApps development for Recon HUDs
Apps development for Recon HUDsXavier Hallade
 
Programming IoT Gateways in JavaScript with macchina.io
Programming IoT Gateways in JavaScript with macchina.ioProgramming IoT Gateways in JavaScript with macchina.io
Programming IoT Gateways in JavaScript with macchina.ioGünter Obiltschnig
 
Google Wave API: Now and Beyond
Google Wave API: Now and BeyondGoogle Wave API: Now and Beyond
Google Wave API: Now and BeyondMarakana Inc.
 
Тарас Олексин - Sculpt! Your! Tests!
Тарас Олексин  - Sculpt! Your! Tests!Тарас Олексин  - Sculpt! Your! Tests!
Тарас Олексин - Sculpt! Your! Tests!DataArt
 
What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018Somkiat Khitwongwattana
 
Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Luc Bors
 
Google analytics
Google analyticsGoogle analytics
Google analyticsSean Tsai
 
Context and Dependency Injection
Context and Dependency InjectionContext and Dependency Injection
Context and Dependency InjectionWerner Keil
 
Serverless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applicationsServerless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applicationsLoiane Groner
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptwesley chun
 
JSR 82 (bluetooth obex)
JSR 82 (bluetooth obex)JSR 82 (bluetooth obex)
JSR 82 (bluetooth obex)SMIJava
 

Similar to Eddystone beacons demo (20)

Android & Beacons
Android & Beacons Android & Beacons
Android & Beacons
 
A brief overview of BLE on Android
A brief overview of BLE on AndroidA brief overview of BLE on Android
A brief overview of BLE on Android
 
What's new in android jakarta gdg (2015-08-26)
What's new in android   jakarta gdg (2015-08-26)What's new in android   jakarta gdg (2015-08-26)
What's new in android jakarta gdg (2015-08-26)
 
Integrando sua app Android com Chromecast
Integrando sua app Android com ChromecastIntegrando sua app Android com Chromecast
Integrando sua app Android com Chromecast
 
Modeveast Appcelerator Presentation
Modeveast Appcelerator PresentationModeveast Appcelerator Presentation
Modeveast Appcelerator Presentation
 
Stmik bandung
Stmik bandungStmik bandung
Stmik bandung
 
Building Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture ComponentsBuilding Modern Apps using Android Architecture Components
Building Modern Apps using Android Architecture Components
 
Fiware IoT Proposal & Community
Fiware IoT Proposal & Community Fiware IoT Proposal & Community
Fiware IoT Proposal & Community
 
Night Watch with QA
Night Watch with QANight Watch with QA
Night Watch with QA
 
Apps development for Recon HUDs
Apps development for Recon HUDsApps development for Recon HUDs
Apps development for Recon HUDs
 
Programming IoT Gateways in JavaScript with macchina.io
Programming IoT Gateways in JavaScript with macchina.ioProgramming IoT Gateways in JavaScript with macchina.io
Programming IoT Gateways in JavaScript with macchina.io
 
Google Wave API: Now and Beyond
Google Wave API: Now and BeyondGoogle Wave API: Now and Beyond
Google Wave API: Now and Beyond
 
Тарас Олексин - Sculpt! Your! Tests!
Тарас Олексин  - Sculpt! Your! Tests!Тарас Олексин  - Sculpt! Your! Tests!
Тарас Олексин - Sculpt! Your! Tests!
 
What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018What's new in Android P @ I/O Extended Bangkok 2018
What's new in Android P @ I/O Extended Bangkok 2018
 
Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)Reaching out from ADF Mobile (ODTUG KScope 2014)
Reaching out from ADF Mobile (ODTUG KScope 2014)
 
Google analytics
Google analyticsGoogle analytics
Google analytics
 
Context and Dependency Injection
Context and Dependency InjectionContext and Dependency Injection
Context and Dependency Injection
 
Serverless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applicationsServerless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applications
 
Exploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScriptExploring Google (Cloud) APIs with Python & JavaScript
Exploring Google (Cloud) APIs with Python & JavaScript
 
JSR 82 (bluetooth obex)
JSR 82 (bluetooth obex)JSR 82 (bluetooth obex)
JSR 82 (bluetooth obex)
 

Recently uploaded

NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...Amil baba
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...vershagrag
 
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptxrouholahahmadi9876
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdfAldoGarca30
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...ronahami
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Ramkumar k
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...drmkjayanthikannan
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxpritamlangde
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxNANDHAKUMARA10
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...ppkakm
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 

Recently uploaded (20)

NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
💚Trustworthy Call Girls Pune Call Girls Service Just Call 🍑👄6378878445 🍑👄 Top...
 
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptx
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Signal Processing and Linear System Analysis
Signal Processing and Linear System AnalysisSignal Processing and Linear System Analysis
Signal Processing and Linear System Analysis
 

Eddystone beacons demo

  • 1. Eddystone Beacons Demo Lecture on Eddystone, an open Bluetooth Smart Beacon format from Google +Angelo Rüggeberg @s3xy4ngyc
  • 2. agenda - Introductions to Beacons - Introduction to Eddystone - Coding Session
  • 5. Location, Accuracy, Range, and alike Image: Google …
  • 9. Opportunities • Contextual fencing (aka Geo-fence) • Contextual content (e.g. reader circle) • … Image: Bundesarchiv
  • 10. Landscape • AltBeacon • Apple‘s property: iBeacon™ • Estimote • Gimbal™ • PayPal™ Beacon • yoints • … • Bluetooth® SIG (Special Interest Group) • Bluetooth® Smart Beacon • Eddystone™ • https://github. com/google/eddystone/tree/mast er/branding
  • 12. Eddystone™, what’s so special? Openness • It is an open Bluetooth 4.0 protocol • While iBeacon™ is officially supported by iOS devices only, Eddystone™ has official support for both iOS and Android Packet types / frames • Eddystone-UID (identifier) • Namespace as UUID • Instance (6 bytes), much like Major and Minor • Eddystone-URL • Eddystone-TLM (telemetry) • battery voltage • temperature • number of packets since last reboot • beacon uptime since last reboot
  • 13.
  • 14. Hardware Phones can become Smart Beacons themselves • TxEddystone-UID (Android Lollipop 5.0) Almost all devices with BLE can become Smart Beacons themselves • BlueGiga BLED112 Dongle • Cambridge Silicon Radio CSR1010 (Beacon Development Board) • Rfduino • Linux (bluez) • ARM mbed (Nordic nRF51-dongle, nRF51-DK) • Node.js (node-eddystone-beacon using bleno) • Arduino (BLEPeripheral), using Nordic Semiconductor's nRF8001 or nR51822 https://github. com/google/eddystone/tree/master/eddyst one-uid/tools/txeddystone-uid
  • 15. Some Bluetooth® Facts • Bluetooth / BLE is a wireless protocol • Bluetooth uses UHF radio waves in the ISM band from 2.4 to 2.485 GHz divided into channels with frequency hopping • Signal strength is an indicator for proximity (RSSI, received signal strength indicator) • BLE has reduced power consumption • Bluetooth SIG predicts more than 90% of Bluetooth-enabled smartphones will support the low energy standard by 2018.
  • 16.
  • 17.
  • 18. Coding a Simple BLE Scanner
  • 19. Prerequisites • Real device with BLE (emulator has no Bluetooth™ support) • Alternative emulator http: //stackoverflow. com/questions/20348743/blue tooth-low-energy-on-android- emulator/27712017 • Android 4.3 (Jelly Bean, API Level 18) • Android 4.4.4 (KitKat, API Level 19) fixes some issues (e.g. https://code.google. com/p/android/issues/detail? id=67272) • Android 5.0 (Lollipop, API Level 21) recommended due to some API changes (e.g. Advertisement and LE Scanner)
  • 20. BLE Permissions for an App • <!– Allow any Bluetooth communication --> <uses-permission android:name="android.permission.BLUETOOTH"/> <!– Allow device discovery --> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> • <uses-feature android:name="android.hardware.bluetooth_le" android:required="true“ />
  • 22. public class MainActivity extends AppCompatActivity { // Declare Bluetooth adapter private BluetoothManager bluetoothManager; private BluetoothAdapter bluetoothAdapter;
  • 23. public class MainActivity extends AppCompatActivity { // Declare Bluetooth adapter private BluetoothManager bluetoothManager; private BluetoothAdapter bluetoothAdapter;
  • 24. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Initialize Bluetooth adapter bluetoothManager = (BluetoothManager) getSystemService(Context. BLUETOOTH_SERVICE); bluetoothAdapter = bluetoothManager.getAdapter(); …
  • 25. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Initialize Bluetooth adapter bluetoothManager = (BluetoothManager) getSystemService(Context. BLUETOOTH_SERVICE); bluetoothAdapter = bluetoothManager.getAdapter(); …
  • 26. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Initialize Bluetooth adapter bluetoothManager = (BluetoothManager) getSystemService(Context. BLUETOOTH_SERVICE); bluetoothAdapter = bluetoothManager.getAdapter(); …
  • 27. bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { Log.d(TAG, "Device-Adress: " + device.getAddress()); Log.d(TAG, "RSSI: " + rssi); } });
  • 28. bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { Log.d(TAG, "Device-Adress: " + device.getAddress()); Log.d(TAG, "RSSI: " + rssi); } });
  • 29. bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { Log.d(TAG, "Device-Adress: " + device.getAddress()); Log.d(TAG, "RSSI: " + rssi); } });
  • 30. bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { Log.d(TAG, "Device-Adress: " + device.getAddress()); Log.d(TAG, "RSSI: " + rssi); } });
  • 31. bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { if(device.getAddress().equals("C1:4F:F1:FF:9B:90")) { Log.d(TAG, "Device-Adress: " + device.getAddress()); Log.d(TAG, "RSSI: " + rssi); } } });
  • 32. bluetoothAdapter.startLeScan(new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { if(device.getAddress().equals("C1:4F:F1:FF:9B:90")) { Log.d(TAG, "Device-Adress: " + device.getAddress()); Log.d(TAG, "RSSI: " + rssi); } } });
  • 33. Move away from deprecated Methods
  • 34. bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner(); bluetoothLeScanner.startScan(new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); } @Override public void onBatchScanResults(List<ScanResult> results) { super.onBatchScanResults(results); } });
  • 35. bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner(); bluetoothLeScanner.startScan(new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); } @Override public void onBatchScanResults(List<ScanResult> results) { super.onBatchScanResults(results); } });
  • 36. bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner(); bluetoothLeScanner.startScan(new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); } @Override public void onBatchScanResults(List<ScanResult> results) { super.onBatchScanResults(results); } });
  • 37. bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner(); bluetoothLeScanner.startScan(new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); } @Override public void onBatchScanResults(List<ScanResult> results) { super.onBatchScanResults(results); } });
  • 38. bluetoothLeScanner.startScan(filters, settings, new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); } });
  • 39. bluetoothLeScanner.startScan(filters, settings, new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); } });
  • 40. ScanSettings settings = new ScanSettings.Builder() .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY) .build(); List<ScanFilter> filters = new ArrayList<>(); ScanFilter filter = new ScanFilter.Builder() .setDeviceAddress("C1:4F:F1:FF:9B:90") .build(); filters.add(filter);
  • 41. ScanSettings settings = new ScanSettings.Builder() .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY) .build(); List<ScanFilter> filters = new ArrayList<>(); ScanFilter filter = new ScanFilter.Builder() .setDeviceAddress("C1:4F:F1:FF:9B:90") .build(); filters.add(filter);
  • 42. ScanSettings settings = new ScanSettings.Builder() .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY) .build(); List<ScanFilter> filters = new ArrayList<>(); ScanFilter filter = new ScanFilter.Builder() .setDeviceAddress("C1:4F:F1:FF:9B:90") .build(); filters.add(filter);
  • 43. ScanSettings settings = new ScanSettings.Builder() .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY) .build(); List<ScanFilter> filters = new ArrayList<>(); ScanFilter filter = new ScanFilter.Builder() .setDeviceAddress("C1:4F:F1:FF:9B:90") .build(); filters.add(filter);
  • 44. ScanSettings settings = new ScanSettings.Builder() .setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY) .build(); List<ScanFilter> filters = new ArrayList<>(); ScanFilter filter = new ScanFilter.Builder() .setDeviceAddress("C1:4F:F1:FF:9B:90") .build(); filters.add(filter);
  • 45.
  • 47. There is only one packet format for BLE which
  • 48. Payload consists of 2 Bytes Header, 6 Bytes Mac Address and up to 31 Bytes data.
  • 50. Fixed: 02 01 06 03 03 aa fe Length: 15 Fixed: 16 aa fe Frame Type: 00 TX Power: ed Namespace: ed d1 eb ea c0 4e 5d ef a0 17 Instance: c5 61 2a 8c c2 53 ... 04 09 ... 45 53 54 03 03 Bat. Service: 0f 18 0e ... 16 0a 18 Mac: 53 c2 8c 2a 61 c5 ... 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  • 51. Fixed: 02 01 06 03 03 aa fe Length: 11 Fixed: 16 aa fe Frame Type: 20 Version: 00 Volt: 0c 06 Temo: 13 00 Adv. Count: 00 0f 70 77 Sec. Count: 00 14 4e 70 ... 04 09 ... 45 53 54 03 03 Bat. Service: 0f 18 0e ... 16 0a 18 Mac: 53 c2 8c 2a 61 c5 ... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  • 52. // The Eddystone Service UUID, 0xFEAA. private static final ParcelUuid EDDYSTONE_SERVICE_UUID = ParcelUuid.fromString("0000FEAA-0000-1000-8000- 00805F9B34FB"); // Eddystone frame types private static final byte TYPE_UID = 0x00; private static final byte TYPE_URL = 0x10; private static final byte TYPE_TLM = 0x20;
  • 53. // The Eddystone Service UUID, 0xFEAA. private static final ParcelUuid EDDYSTONE_SERVICE_UUID = ParcelUuid.fromString("0000FEAA-0000-1000-8000- 00805F9B34FB"); // Eddystone frame types private static final byte TYPE_UID = 0x00; private static final byte TYPE_URL = 0x10; private static final byte TYPE_TLM = 0x20;
  • 54. // The Eddystone Service UUID, 0xFEAA. private static final ParcelUuid EDDYSTONE_SERVICE_UUID = ParcelUuid.fromString("0000FEAA-0000-1000-8000- 00805F9B34FB"); // Eddystone frame types private static final byte TYPE_UID = 0x00; private static final byte TYPE_URL = 0x10; private static final byte TYPE_TLM = 0x20;
  • 55. // The Eddystone Service UUID, 0xFEAA. private static final ParcelUuid EDDYSTONE_SERVICE_UUID = ParcelUuid.fromString("0000FEAA-0000-1000-8000- 00805F9B34FB"); // Eddystone frame types private static final byte TYPE_UID = 0x00; private static final byte TYPE_URL = 0x10; private static final byte TYPE_TLM = 0x20;
  • 56. // The Eddystone Service UUID, 0xFEAA. private static final ParcelUuid EDDYSTONE_SERVICE_UUID = ParcelUuid.fromString("0000FEAA-0000-1000-8000- 00805F9B34FB"); // Eddystone frame types private static final byte TYPE_UID = 0x00; private static final byte TYPE_URL = 0x10; private static final byte TYPE_TLM = 0x20;
  • 58. bluetoothLeScanner.startScan(filters, settings, new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID); byte frameType = data[0]; if (frameType != TYPE_TLM) { return; } // Beacon temperature double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() / 256.0; Log.d(TAG, String.format("%.2f°C", temp)); } });
  • 59. bluetoothLeScanner.startScan(filters, settings, new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID); byte frameType = data[0]; if (frameType != TYPE_TLM) { return; } // Beacon temperature double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() / 256.0; Log.d(TAG, String.format("%.2f°C", temp)); } });
  • 60. bluetoothLeScanner.startScan(filters, settings, new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID); byte frameType = data[0]; if (frameType != TYPE_TLM) { return; } // Beacon temperature double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() / 256.0; Log.d(TAG, String.format("%.2f°C", temp)); } });
  • 61. bluetoothLeScanner.startScan(filters, settings, new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID); byte frameType = data[0]; if (frameType != TYPE_TLM) { return; } // Beacon temperature double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() / 256.0; Log.d(TAG, String.format("%.2f°C", temp)); } });
  • 62. Fixed: 02 01 06 03 03 aa fe Length: 11 Fixed: 16 aa fe Frame Type: 20 Version: 00 Volt: 0c 06 Temo: 13 00 Adv. Count: 00 0f 70 77 Sec. Count: 00 14 4e 70 ... 04 09 ... 45 53 54 03 03 Bat. Service: 0f 18 0e ... 16 0a 18 Mac: 53 c2 8c 2a 61 c5 ... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  • 63. bluetoothLeScanner.startScan(filters, settings, new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID); byte frameType = data[0]; if (frameType != TYPE_TLM) { return; } // Beacon temperature double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() / 256.0; Log.d(TAG, String.format("%.2f°C", temp)); } });
  • 64. bluetoothLeScanner.startScan(filters, settings, new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID); byte frameType = data[0]; if (frameType != TYPE_TLM) { return; } // Beacon temperature double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() / 256.0; Log.d(TAG, String.format("%.2f°C", temp)); } });
  • 65. bluetoothLeScanner.startScan(filters, settings, new ScanCallback() { @Override public void onScanResult(int callbackType, ScanResult result) { super.onScanResult(callbackType, result); byte[] data = result.getScanRecord().getServiceData(EDDYSTONE_SERVICE_UUID); byte frameType = data[0]; if (frameType != TYPE_TLM) { return; } // Beacon temperature double temp = new BigInteger(Arrays.copyOfRange(data, 4, 6)).intValue() / 256.0; Log.d(TAG, String.format("%.2f°C", temp)); } });