![Page 1: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/1.jpg)
![Page 2: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/2.jpg)
DEMYSTIFYING ANDROID'S BLUETOOTH LOW ENERGY
Paweł UrbanSenior Software Engineer
Dariusz SewerynSenior Software Engineer
![Page 3: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/3.jpg)
BLUETOOTH LOW ENERGY
![Page 4: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/4.jpg)
BLUETOOTH LOW ENERGY
ANDROID’S NATIVE SUPPORT
![Page 5: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/5.jpg)
BLUETOOTH LOW ENERGY
ANDROID’S NATIVE SUPPORT
YOUR SECRET WEAPON
![Page 6: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/6.jpg)
WHY SHOULD I CARE ABOUT BLE?
![Page 7: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/7.jpg)
![Page 8: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/8.jpg)
The Internet of Things – infographic The Connectivist based on Cisco data
![Page 9: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/9.jpg)
2006
![Page 10: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/10.jpg)
2006 2010
![Page 11: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/11.jpg)
2006 2010 2013
![Page 12: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/12.jpg)
A DEVELOPER PERSPECTIVE
![Page 13: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/13.jpg)
Jelly Bean
![Page 14: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/14.jpg)
BACKWARD SUPPORT
![Page 15: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/15.jpg)
BACKWARD SUPPORT
![Page 16: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/16.jpg)
BACKWARD SUPPORTBETA
![Page 17: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/17.jpg)
BACKWARD SUPPORTBETA
![Page 18: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/18.jpg)
LOW ENERGY
![Page 19: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/19.jpg)
GAP (GENERIC ACCESS PROFILE)
![Page 20: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/20.jpg)
PERIPHERAL
![Page 21: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/21.jpg)
PERIPHERAL CENTRAL
![Page 22: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/22.jpg)
PERIPHERAL CENTRAL
ADVERTISE PRESENCE
![Page 23: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/23.jpg)
PERIPHERAL CENTRAL
ADVERTISE PRESENCECONNECTION HANDSHAKE
![Page 24: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/24.jpg)
CLIENT
PERIPHERAL CENTRAL
ADVERTISE PRESENCECONNECTION HANDSHAKE
SERVER
![Page 25: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/25.jpg)
CLIENT
PERIPHERAL CENTRAL
ADVERTISE PRESENCECONNECTION HANDSHAKE
SERVER
READ/WRITE DATA REQ
RESPOND WITH DATA
![Page 26: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/26.jpg)
GATT (Generic Attribute Profile)
![Page 27: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/27.jpg)
Texas Instruments SensorTAG
![Page 28: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/28.jpg)
Peripheral device
Service A
Characteristic 1 Characteristic 2
DEVICE
![Page 29: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/29.jpg)
Peripheral deviceDEVICE
SENSOR
Service A
Characteristic 1 Characteristic 2
![Page 30: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/30.jpg)
Peripheral deviceDEVICE
SENSOR
36.6°C SENSOR VALUE
Service A
Characteristic 1 Characteristic 2
![Page 31: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/31.jpg)
Peripheral deviceDEVICE
SENSOR
36.6°C SENSOR VALUE
Service A
Characteristic 1 Characteristic 2
SENSOR CONFIGURATION
![Page 32: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/32.jpg)
Peripheral deviceDEVICE
SENSOR
36.6°C SENSOR VALUE
Service A
Characteristic 1 Characteristic 2
SENSOR CONFIGURATION
READ WRITE NOTIFY
![Page 33: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/33.jpg)
Peripheral device
Service A
Characteristic 1 Characteristic 2
Service B
Characteristic 3 Characteristic 4
Service C
Characteristic 5 Characteristic 6
DISCOVERY
![Page 34: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/34.jpg)
UUID
1 TEMPERATURE(„4E99FFF1-4B3E-11E5-9D65-0002A5D5C51B"); 2 HUMIDITY(„4E99FFF2-4B3E-11E5-9D65-0002A5D5C51B"); 3 TIME(„5E99FFC1-4B3E-11E5-9D65-0002A5D5C51B"); 4 DEVICE_NAME(„00002a26-0000-1000-8000-00805f9b34fb”);
![Page 35: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/35.jpg)
UUID
1 TEMPERATURE(„4E99FFF1-4B3E-11E5-9D65-0002A5D5C51B"); 2 HUMIDITY(„4E99FFF2-4B3E-11E5-9D65-0002A5D5C51B"); 3 TIME(„5E99FFC1-4B3E-11E5-9D65-0002A5D5C51B"); 4 DEVICE_NAME(„00002a26-0000-1000-8000-00805f9b34fb”);
128-bit
![Page 36: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/36.jpg)
UUID
1 TEMPERATURE(„4E99FFF1-4B3E-11E5-9D65-0002A5D5C51B"); 2 HUMIDITY(„4E99FFF2-4B3E-11E5-9D65-0002A5D5C51B"); 3 TIME(„5E99FFC1-4B3E-11E5-9D65-0002A5D5C51B"); 4 DEVICE_NAME(„00002a26-0000-1000-8000-00805f9b34fb”);
16-bit
![Page 37: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/37.jpg)
THE SCARY PART
![Page 38: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/38.jpg)
BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();final boolean startLeScan = bluetoothAdapter.startLeScan(leScanCallback);
BluetoothAdapter.LeScanCallback leScanCallback = new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { // processing results }};
bluetoothAdapter.stopLeScan(leScanCallback);
SCAN
![Page 39: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/39.jpg)
BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();final boolean startLeScan = bluetoothAdapter.startLeScan(leScanCallback);
BluetoothAdapter.LeScanCallback leScanCallback = new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { // processing results }};
bluetoothAdapter.stopLeScan(leScanCallback);
SCAN
![Page 40: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/40.jpg)
BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();final boolean startLeScan = bluetoothAdapter.startLeScan(leScanCallback);
BluetoothAdapter.LeScanCallback leScanCallback = new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { // processing results }};
bluetoothAdapter.stopLeScan(leScanCallback);
SCAN
![Page 41: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/41.jpg)
BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();final boolean startLeScan = bluetoothAdapter.startLeScan(leScanCallback);
BluetoothAdapter.LeScanCallback leScanCallback = new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { // processing results }};
bluetoothAdapter.stopLeScan(leScanCallback);
SCAN
![Page 42: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/42.jpg)
BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();final boolean startLeScan = bluetoothAdapter.startLeScan(
new UUID[]{ UUID.fromString(…) }, leScanCallback);
BluetoothAdapter.LeScanCallback leScanCallback = new BluetoothAdapter.LeScanCallback() { @Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { // processing results }};
bluetoothAdapter.stopLeScan(leScanCallback);
SCAN
![Page 43: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/43.jpg)
BluetoothDevice remoteDevice = bluetoothAdapter.getRemoteDevice(getEnteredMacAddress());BluetoothGatt bluetoothGatt = remoteDevice.connectGatt(context, false, callback);BluetoothGattCallback callback = new BluetoothGattCallback() { @Override public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
if (status == BluetoothGatt.GATT_SUCCESS) { if (newState == BluetoothProfile.STATE_CONNECTED) { // You are connected! } else if (newState == BluetoothProfile.STATE_DISCONNECTED) { // Disconnected bluetoothGatt.close(); } } else { // Maybe disconnected? onDisconnectRequested(); } }};
CONNECTION
![Page 44: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/44.jpg)
BluetoothDevice remoteDevice = bluetoothAdapter.getRemoteDevice(getEnteredMacAddress());BluetoothGatt bluetoothGatt = remoteDevice.connectGatt(context, false, callback);BluetoothGattCallback callback = new BluetoothGattCallback() { @Override public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
if (status == BluetoothGatt.GATT_SUCCESS) { if (newState == BluetoothProfile.STATE_CONNECTED) { // You are connected! } else if (newState == BluetoothProfile.STATE_DISCONNECTED) { // Disconnected bluetoothGatt.close(); } } else { // Maybe disconnected? onDisconnectRequested(); } }};
CONNECTION
![Page 45: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/45.jpg)
BluetoothDevice remoteDevice = bluetoothAdapter.getRemoteDevice(getEnteredMacAddress());BluetoothGatt bluetoothGatt = remoteDevice.connectGatt(context, false, callback);BluetoothGattCallback callback = new BluetoothGattCallback() { @Override public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
if (status == BluetoothGatt.GATT_SUCCESS) { if (newState == BluetoothProfile.STATE_CONNECTED) { // You are connected! } else if (newState == BluetoothProfile.STATE_DISCONNECTED) { // Disconnected bluetoothGatt.close(); } } else { // Maybe disconnected? onDisconnectRequested(); } }};
CONNECTION
![Page 46: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/46.jpg)
BluetoothDevice remoteDevice = bluetoothAdapter.getRemoteDevice(getEnteredMacAddress());BluetoothGatt bluetoothGatt = remoteDevice.connectGatt(context, false, callback);BluetoothGattCallback callback = new BluetoothGattCallback() { @Override public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
if (status == BluetoothGatt.GATT_SUCCESS) { if (newState == BluetoothProfile.STATE_CONNECTED) { // You are connected! } else if (newState == BluetoothProfile.STATE_DISCONNECTED) { // Disconnected bluetoothGatt.close(); } } else { // Maybe disconnected? onDisconnectRequested(); } }};
CONNECTION
![Page 47: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/47.jpg)
BluetoothDevice remoteDevice = bluetoothAdapter.getRemoteDevice(getEnteredMacAddress());BluetoothGatt bluetoothGatt = remoteDevice.connectGatt(context, false, callback);BluetoothGattCallback callback = new BluetoothGattCallback() { @Override public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
if (status == BluetoothGatt.GATT_SUCCESS) { if (newState == BluetoothProfile.STATE_CONNECTED) { // You are connected! } else if (newState == BluetoothProfile.STATE_DISCONNECTED) { // Disconnected bluetoothGatt.close(); } } else { // Maybe disconnected? onDisconnectRequested(); } }};
CONNECTION
![Page 48: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/48.jpg)
boolean startedDiscovering = bluetoothGatt.discoverServices();
@Overridepublic void onServicesDiscovered(BluetoothGatt gatt, int status) { if (status == BluetoothGatt.GATT_SUCCESS) { BluetoothGattService service = gatt.getService(serviceUUID); BluetoothGattCharacteristic characteristic = service.getCharacteristic(characteristicUUID); boolean startedReadOperation = gatt.readCharacteristic(characteristic); // ... } else { // ... }}
@Overridepublic void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) { if (status == BluetoothGatt.GATT_SUCCESS) { byte[] characteristicValue = characteristic.getValue(); } else { // ... }}
READING DATA
![Page 49: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/49.jpg)
boolean startedDiscovering = bluetoothGatt.discoverServices();
@Overridepublic void onServicesDiscovered(BluetoothGatt gatt, int status) { if (status == BluetoothGatt.GATT_SUCCESS) { BluetoothGattService service = gatt.getService(serviceUUID); BluetoothGattCharacteristic characteristic = service.getCharacteristic(characteristicUUID); boolean startedReadOperation = gatt.readCharacteristic(characteristic); // ... } else { // ... }}
@Overridepublic void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) { if (status == BluetoothGatt.GATT_SUCCESS) { byte[] characteristicValue = characteristic.getValue(); } else { // ... }}
READING DATA
![Page 50: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/50.jpg)
boolean startedDiscovering = bluetoothGatt.discoverServices();
@Overridepublic void onServicesDiscovered(BluetoothGatt gatt, int status) { if (status == BluetoothGatt.GATT_SUCCESS) { BluetoothGattService service = gatt.getService(serviceUUID); BluetoothGattCharacteristic characteristic = service.getCharacteristic(characteristicUUID); boolean startedReadOperation = gatt.readCharacteristic(characteristic); // ... } else { // ... }}
@Overridepublic void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) { if (status == BluetoothGatt.GATT_SUCCESS) { byte[] characteristicValue = characteristic.getValue(); } else { // ... }}
READING DATA
![Page 51: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/51.jpg)
boolean startedDiscovering = bluetoothGatt.discoverServices();
@Overridepublic void onServicesDiscovered(BluetoothGatt gatt, int status) { if (status == BluetoothGatt.GATT_SUCCESS) { BluetoothGattService service = gatt.getService(serviceUUID); BluetoothGattCharacteristic characteristic = service.getCharacteristic(characteristicUUID); boolean startedReadOperation = gatt.readCharacteristic(characteristic); // ... } else { // ... }}
@Overridepublic void onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) { if (status == BluetoothGatt.GATT_SUCCESS) { byte[] characteristicValue = characteristic.getValue(); } else { // ... }}
READING DATA
![Page 52: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/52.jpg)
@Override void onCharacteristicChanged(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic)@Overridevoid onCharacteristicRead(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status)@Overridevoid onCharacteristicWrite(BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status)@Overridevoid onConnectionStateChange(BluetoothGatt gatt, int status, int newState)@Overridevoid onDescriptorRead(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status)@Overridevoid onDescriptorWrite(BluetoothGatt gatt, BluetoothGattDescriptor descriptor, int status)@Overridevoid onServicesDiscovered(BluetoothGatt gatt, int status)@Overridevoid onMtuChanged(BluetoothGatt gatt, int mtu, int status)@Overridevoid onReadRemoteRssi(BluetoothGatt gatt, int rssi, int status)@Overridevoid onReliableWriteCompleted(BluetoothGatt gatt, int status)
![Page 53: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/53.jpg)
DOES IT HAVE TO BE HARD?
![Page 54: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/54.jpg)
RxAndroidBLENo! Just use
![Page 55: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/55.jpg)
RXJAVA
![Page 56: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/56.jpg)
OBSERVABLE
RXJAVA
![Page 57: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/57.jpg)
Device Scanning
OBSERVABLE
![Page 58: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/58.jpg)
Device Scanning
Scanned device
![Page 59: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/59.jpg)
Device Scanning
Scanned device
![Page 60: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/60.jpg)
Device Scanning
Scanned device
![Page 61: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/61.jpg)
Device Scanning
![Page 62: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/62.jpg)
Device Scanning
Establish Connection
![Page 63: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/63.jpg)
Device Scanning
Connecting to deviceEstablish Connection
![Page 64: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/64.jpg)
Device Scanning
Connecting to deviceEstablish Connection
![Page 65: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/65.jpg)
Read Characteristic
Device Scanning
Connecting to deviceEstablish Connection
![Page 66: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/66.jpg)
Device Scanning
Connecting to device
Reading Characteristic ValueRead Characteristic
Establish Connection
![Page 67: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/67.jpg)
Device Scanning
Connecting to device
Reading Characteristic ValueRead Characteristic
Establish Connection
![Page 68: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/68.jpg)
Declaration of what we want to achieve
Device Scanning
Connecting to device
Reading Characteristic ValueRead Characteristic
Establish Connection
![Page 69: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/69.jpg)
Device Scanning
Connecting to device
Reading Characteristic ValueRead Characteristic
Establish Connection
![Page 70: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/70.jpg)
Device Scanning
Connecting to device
Some action
Do something
Establish Connection
![Page 71: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/71.jpg)
Device Scanning
Connecting to device
Some action
Do something
Establish Connection
![Page 72: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/72.jpg)
Device Scanning
Connecting to device
Some action
Do something
Establish Connection
![Page 73: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/73.jpg)
THE DEMO
![Page 74: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/74.jpg)
SAY THAT AGAIN?
![Page 75: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/75.jpg)
Q&As?
![Page 76: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/76.jpg)
LET’S CHAT!
@DSeweryn
+PawełUrban
https://git.io/vw8PM
![Page 77: Demystifying Android's Bluetooth Low Energy at MCE^3 Conf](https://reader031.vdocument.in/reader031/viewer/2022011721/58a1f1df1a28ab531e8b6f27/html5/thumbnails/77.jpg)
Thank You!@DSeweryn +PawełUrban
https://git.io/vw8PM