문제

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