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"
Software Engineer, Kutir Mobility
Posted on behalf of Zebra Technologies
As you probably know, there were tricks to get this value, despite the fact that this security limitation was established in version 6. This alternative way worked until Oreo 8.0. However, Oreo 8.1 has been blocked.
I understand that data protection is important, but the great majority of Zebra devices are oriented to the industrial environment, not for consumer. For software developers, who work to offer simple applications to users, this type of data is fundamental.
Thanks for you annswer.
Hi Eduardo. Why do you need to know the MAC address of the Android device when you are connecting to an SPP Bluetooth scanner, wouldn't you just need the MAC address of the scanner so you can connect to it (where the scanner is acting as the BT slave). Sorry if I'm not understanding something here.
Sorry for my delay in response.
I will try to explain the problem and why we need to access the Bluetooth MAC ADDRESS.
We develop applications for one of the largest integrators in France. We have numerous customers that work with Windows CE / Mobile terminals that use, at the same time, the internal scanner and an external scanner (wired or BT) depending on the operations that the user has to perform.
Now we are developing the same solutions in Android environment (migration). And customers want to keep their way of working, with two scanners simultaneously.
We consulted with Zebra support to be able to implement this way of working and they informed us that: we can only have one scanner connected at a time using the EMDK and SSI. OK, then the solution is that the Internal Scanner will be using SSI and the BT scanner (RS507, for example) via SPP.
Knowing that we need to connect the external scanner in SPP mode, we need the MAC ADDRESS to be able to create the barcode, which allows users to easily pair the BT scanner. The same case as performing the Bluetooth Pairing Utility for SSI mode.
I hope my explanation complements my initial question. Thank you.
That is interesting... I had not realised that SPP supported the RS507 acting as both the master or the slave but that is indeed the case, thank you for teaching me something
If you can't connect the RS507 as the client, therefore negating the need to generate the Android device's MAC address barcode, and need the RS507 to connect as the master then I'm afraid access to the device MAC address would be a feature request and if you have already been speaking with support then that would be the best channel to raise this request. If you are interested, I do have an app I created a while back that connects to the RS507 when it is connected in SPP client mode: GitHub - darryncampbell/GenericScanWedge: Implements an Android service that provides a rudimentary implementation of Ze…