Programmatically Obtain the Bluetooth MAC Address in Android Oreo Version

E Eduardo Rubio Rey 3 years 6 months ago
335 1 0

Hi community,

We connect the external scanners to the devices in SPP mode. We are doing tests with a terminal TC51 with Android Oreo (8.1) and I am not able to find how to obtain the MAC address of the Bluetooth, programmatically. With versions of Android before Oreo, we know how to do it, but this functionality has changed with Oreo, someone knows how to get it?

Thank you

Please Register or Login to post a reply

1 Replies

D Dmitry Prokhorov

Hello Eduardo,

As you can see here Android 6.0 Changes  |  Android Developers

Programmatic access to to MAC addresses has been removed starting from Android 6.0:
"To provide users with greater data protection, starting in this release, Android removes programmatic access to the device’s local hardware identifier for apps using the Wi-Fi and Bluetooth APIs. The WifiInfo.getMacAddress() and the BluetoothAdapter.getAddress() methods now return a constant value of 02:00:00:00:00:00"

Dmitry Prokhorov
Software Engineer, Kutir Mobility
Posted on behalf of Zebra Technologies

CONTACT
Can’t find what you’re looking for?