I have following problem: When my headset is turned on before my phone bluetooth is on, it will not connect to my phone. It will only connect to my phone when phone bluetooth is on and my headset is turned on second. I found out that I can still connect to my headset when bluetooth is turned on second (1. case), by going into androids bluetooth menu where my paired devices are listed and select my headset (although my headset is listed as 'connected'). This will connect my headset and my phone too.
What I now want to do is to perform the second way of connecting to my headset, when my phone bluetooth is turnd on second, programatically. I want to use android version 2.0 (API Level 5), so i tried BluetoothDevice.createRfcommSocketToServiceRecord
and called connect()
on my socket. But I'm always getting an Exception "Connection refused" or "Service discovery failed". I have used many UUID which I thought could be the right one and have anything to do with headset.