views:

1078

answers:

1

I am looking for a way to initiate the audio connection between the Android phone and my headset within my application. The idea is to simplify the connection process in such a way that the user doesn't have to go through the different settings menus anymore (Apps -> Settings -> Wireless & Networs -> Bluetooth settings).

Both devices are supposed to be already paired and the Bluetooth address of the headset to be known.

As far as I learned, the Bluetooth capabilities (available since version 2.0 of the Android SDK) are restricted to Bluetooth discovery and the connection of RFComm channels (host/client) between the Android phone and a Bluetooth device. Is there another way to request Bluetooth profiles on the Android system to initiate a connection to a known device from an app or is this impossible?

A: 

Have you looked at the BluetoothAdapter class? It seems like you can do everything you need via that class, unless I misunderstand the question.

As for initiating a connection to a specific device, won't the phone auto-pair with the known device once you enable bluetooth?

mbaird
If I understand it correctly the BluetoothAdapter class gives me only control to a portion of Androids Bluetooth stack: with BluetoothAdapter you're certainly able to discover other devices and control the Bluetooth radio but it seems impossible to me to initiate a different connection than a RFComm link. Please correct me if I am wrong...As for auto-pair: that works sometimes. Most if the time however, I find myself waiting for an auto-connection for a long time (with no success) and that is why I am rather interested in a programmatic solution.
Jiri Holzbecher