I have an android app with no touchscreen or user interface, just a display. I want to connect a phone to it via bluetooth to control the display.
I am able to connect fine except for one thing. Every time I make the device discoverable a dialog pops up, for permission to make it discoverable. How do I programmatically accept discoverability on a device with no touchscreen or keyboard?
You need to know the MAC or the name of the Bluetooth:
B4X:
Serial1.Connect("98:76:B6:00:42:34") ' mac address from serial1.GetPairedDevices()
Serial1.Connect(PairedDevices.Get("DeviceName")) 'convert the name to mac address
This is a catch 22 -- new users are unknow until paired, I need the paring process to work with no user interface on one end.
Actually, I think i can solve the issue by reversing the connections, making the stationary app search, and the phone discoverable, than use the BtAutoPair library to connect. That way the user on the phone can accept the dialog. I'll try this approach.