Stephan van Hulst wrote:Welcome to CodeRanch!
Why do you need the MAC address? Programmatic access was removed for a reason.
Tim Moores wrote:There are good reasons for wanting to get the MAC addresses of networked devices - Wake-On-Lan for example.
The output of the "ip" command (which you can run via Runtime.exec) has all kinds of useful information. "ip addr" has more data than you'll get from NetworkInterface, for example. "ip neigh show" has MAC addresses of known hosts on the same network, especially after doing a subnet scan (meaning, making connections to those hosts).
Android API 30 curtails the "ip" command, unfortunately, also in the name of protecting MAC addresses. I have not found a workaround, so it may be gone for good.