I found 4 different ways to connect the Bluetooth device in Android after the scanning:
- createBond -> mBluetoothAdapter.getProfileProxy(this, new InputDeviceServiceListener(),BluetoothProfile.INPUT_DEVICE) -> BluetoothInputDevice.connect
- createBond -> mBluetoothAdapter.getProfileProxy(this, new BluetoothProfile.ServiceListener(),BluetoothProfile.HID_HOST) -> BluetoothHidHost.connect
- createBond -> CachedBluetoothDevice.connect
- call BluetoothDevice.connectGatt directly after the scanning
So what's the difference between those 4 ways? Do we have to use different ways to connect for different Bluetooth devices(RCU, Headset, Phone, etc)? Is there one generic way for all kinds of devices?
I have tried to Google these questions without any lock to find an answer. Any comments will be appreciated.