Programmatically pairing with a BLE device on Android 4.4+
Does anyone have a complete working example of how to programmatically pair with a BLE ( not Bluetooth Classic) device that uses passkey entry (i.e. a 6-digit PIN) or Numeric Comparison on Android 4.4 or later? By 'programmatically' I mean I tell Android the PIN - the user isn't prompted. There are many similar questions about this on SO but they are either a) about Bluetooth Classic, b) old (before setPin() and createBond() were public), or c) unanswered. My understanding is as follows. You connect to the device and discover its services. You try to read a 'protected' characteristic. The