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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top