I'm using RxAndroidBle
library to scan and connect with BLE devices. What I also need is to pair with this found device, without displaying system dialog about the key pairing. The bonding mechanism is JustWorks
.
I've already achieved that by creating BroadcastReceiver
, following the gist I posted below(credits to @dglozano).
Code gist: https://gist.github.com/dglozano/9b0ce38a558eeca16137909bd368698c
It actually works pretty well but I would like to understand why when I'm simply using rxBleDevice.bluetoothDevice.createBond()
it displays the Dialog
but when I handle it by my own BroadcastReceiver
then, it doesn't. Is this someway unregistering normal BroadcastReceiver that would handle device BOND_STATE
? Why my BroadcastReceiver
takes main control of that? I'm interested in - what happens inside when I'm registering my own receiver
.