Bart Friederichs
Bart Friederichs

Reputation: 33511

BluetoothDevice getName() to return local alias

In Android, you can give paired devices a name that is different from the advertised name from the device itself. However, if I call getName() on the BluetoothDevice I get the device's own name.

Is there a way to fetch the local alias of the device?

Upvotes: 2

Views: 1735

Answers (1)

Petr Šabata
Petr Šabata

Reputation: 635

There's a hidden method getAlias() in BluetoothDevice class. You can access it via reflection as described here: Getting the renamed name of an Android BluetoothDevice. There are no guarantees that hidden APIs will not be broken with next update to Android OS though.

Upvotes: 1

Related Questions