Android Question Bluetooth Pair Automatically

nibbo

Active Member
Licensed User
Longtime User
Hi All

Is it possible to get a bluetooth device to pair automatically?
During the autodiscovery I can see the device listed and I can then connect Serial to it but the tablet always displays 'Bluetooth Pairing request'... 'Pair With...'
Can this bit be bypassed and always connect without asking?

My car doesn't ask me every time I get in so I guess it is possible, is it device dependant or can I do it in B4A using BT Admin?

Thanks
 

nibbo

Active Member
Licensed User
Longtime User
Hi Erel, that's what I was hoping but how do I connect to it the second time?
i.e. after I close and restart the app the device shows in the discoverable list but then how do I start listening to it without issuing serial.connect?
As soon as I issue the connect I get asked to pair it again.
I tried using serial.listen2(name, mac) but that throws an IllegalArgumentException: Invalid UUID {mac addreess}
Thanks
 
Upvote 0

nibbo

Active Member
Licensed User
Longtime User
Hi Erel,

Using your example I get the same thing. After clicking on 'search for devices' I see the previously paired device and select it.
It then shows 'Trying to connect to: Device-Name Mac-Address'.
Then I get the 'Bluetooth pairing request' 'Pair with Device-name?' dialog pop up.

If I pair it again and then close and run the app again it asks to pair every time.

Thanks
Nibbo
 
Upvote 0
Top