How can I get a list of all connected bluetooth devices for Android regardless of profile?
Alternatively, I see that you can get all connected devices for a specific profile via BluetoothManager.getConnectedDevices.
And I guess I could see which devices are connected by listening for connections/disconnections via ACTION_ACL_CONNECTED/ACTION_ACL_DISCONNECTED...seems error prone.
But I'm wondering if there's a simpler way to get the list of all connected bluetooth devices.
To see a complete list, this is a 2-step operation:
To get a list of, and iterate, the currently paired devices:
Discovery is a little bit more of a complex operation. To do this, you'll need to tell the BluetoothAdapter to start scanning/discovering. As it finds things, it sends out Intents that you'll need to receive with a BroadcastReceiver.
First, we'll set up the receiver:
Now all that is left is to tell the BluetoothAdapter to start scanning: