How to get information about CONNECTED bluetooth device for android?

Deeps picture Deeps · Aug 23, 2011 · Viewed 12.1k times · Source

If I have a Android phone which is already connected with a bluetooth headset (paired and connected) to it. How I can get information about that specific headset.

Using getBondedDevices() method I get list of all paired devices..I need information about CONNECTED device only.

I can not wait for broadcast receiver to check status, because I need this information at the start of my application. So please suggest is there any way to get this information without waiting for broadcast.

Answer

jroal picture jroal · Jan 12, 2012

You can do this through the IBluetoothA2dp interface in API 11 and up. Some more info on there is here: Android connect to a paired bluetooth headset

Here is a great resource to see the difference in what is available to this interface between API 10 and 11 where it changed quite a bit. http://grepcode.com/file_/repository.grepcode.com/java/ext/com.google.android/android/4.0.1_r1/android/bluetooth/BluetoothA2dp.java/?v=diff&id2=2.2_r1.1

Hope that helps.