0

I've refer https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-hardware-id and Getting MAC address in Android 6.0. It seems to be unable to get MAC address in android 6.

Without WifiInfo.getMacAddress() and the BluetoothAdapter.getAddress() can we have an other way to get MAC address programmatically of local device.

Community
  • 1
  • 1

1 Answers1

2

Just read the file /sys/class/net/wlan0/address. The MAC address will be in the usual colon deliminated form. Works on my unrooted Nexus 6P running Android 6.0.1.

Niall Douglas
  • 9,212
  • 2
  • 44
  • 54