I have a Bluetooth module that I'd like to automatically connect with my Android phone. Here's what I've done so far:
- The phone and Bluetooth module are paired.
- I have an app which creates a
BluetoothServerSocket
withlistenUsingInescureRfcommWithServiceRecord(<uuid>)
, and then callsaccept()
on that socket (this is all done in a service). - This works when the Bluetooth module tries connecting to the phone's Bluetooth MAC address.
- This also works when under "Bluetooth settings" on the phone, I check the box next to my device to make the phone visible to all devices.
This does not work when the phone is not discoverable to everyone. When the check box is unchecked, it says under my phone "Only visible to paired devices" - my understanding of this is that the phone should be visible to my Bluetooth module, since they are indeed paired... Does anyone have any advice as to why this wouldn't be the case?