Did anyone have a successful experience on working with CompanionDeviceManager on Android? Especially, with the devices with Bluetooth Classic support. I've been testing a pretty simple app which tries to connect some device using Bluetooth Classic and I keep getting different strange errors. The problems I'm facing:
- The internals of
CompanionDeviceManagercan crash with some nullpointer - The API uses
onActivityResultmechanism and often I just get this callback with unsuccessful result (!Activity.RESULT_OK) - But most importantly, it takes way too long to discover a device
So, am I doing something wrong? Or this API is quite unstable?
Yes, Companion Device Pairing can be made to work reliably on BLE devices -- at least as reliably as the alternative pairing (BLE bonding) mechanisms on Android, which have their own issues. The Starfield watch app uses this to pair Android phones with the watch.
I am not surprised that this is not as well tested on Bluetooth Classic, as it appears to be designed for Bluetooth LE watches in particular. For your specific issues, you would need to post code so that we can help with specifics.