Connect to bluetooth headset in Android

I have the following problem: When my headset is turned on, before my phone is turned on, it will not connect to my phone. It only connects to my phone when the Bluetooth phone is turned on and my headset is turned on. I found out that I can still connect to my headset when Bluetooth is turned on on the second one (1. case) by going to the android bluetooth menu where my paired devices are listed and select my headset (although my headset is indicated as “connected”) It will also connect my headset and my phone.

Now I want to make a second way to connect to my headset when my Bluetooth phone is second time, programmatically. I want to use Android version 2.0 (API Level 5), so I tried BluetoothDevice.createRfcommSocketToServiceRecordand named connect()on my socket. But I always get the exception “Connection refused” or “Service failure”. I used a lot of UUIDs that I thought might be correct and have something to do with the headset.

0
source share
1 answer

You cannot call the RFICM api to connect to the headset. It is designed to connect to the SPP profile, the headset will use HS / HFP profiles. Using differnt UUIDs also in RFCOMM apf will not solve the problem.

Android ( ). - . BluetoothHeadset

, , . , , .

+3

All Articles