Question

I am trying to get the list of the bonded bluetooth devices on the phone. My problem is that I am getting it in a "non friendly" way. Here is my code:

BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
    Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
    ArrayList<String> listview = 
        new ArrayList<String>(Arrays.asList(pairedDevices.toString()));

I'm getting: 00:23:7f:5f:fe:1c...

How can i get the friendly names and not numbers?

Just to add that I know about getname(), but as I understand its only for a connected device and not for the bonded devices.

Was it helpful?

Solution

the getName() method of the BluetoothDevice device class will help you out. Just iterate through the Set and call the getName() method on each BluetoothDevice object.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top