1

I need to get WiFi mac address of my android TV box.

I have tried to read /sys/class/net/wlan0/address file. The problem is when device is connected to ethernet(via lan cable) /sys/class/net/wlan0/address file and even /sys/class/net/wlan0/ directory doesn't exists and it's appears only when device is connecting to wifi network. But for example ethernet mac address is always defined and available at /sys/class/net/eth0/address.

Also I have tried to do like it says hear, with java system application. In this case I got same results. My ethernet mac address is always available, but wifi mac appears when I connect to wifi network.

Is it possible to get wifi mac address when device is not connected to wifi ?
Android version: 5.1.1

  • [check this](https://stackoverflow.com/questions/43338359/get-device-mac-adress-in-android-nougat-and-o-programmatically/43339101?noredirect=1#comment73742692_43339101) – sanemars Mar 28 '18 at 08:35
  • @sanemars my android version is 5.1.1 – HaykBeglaryan Mar 28 '18 at 08:45
  • [when WiFi is disabled set it enabled](https://stackoverflow.com/questions/14949872/getting-the-mac-address-of-the-device-when-wifi-is-off) – sanemars Mar 28 '18 at 08:53
  • @sanemars im my device case, if device is connected to ethernet, I'm unable to turn on wifi. My wifi is available only in case when ethernet is not connected. – HaykBeglaryan Mar 28 '18 at 08:58

0 Answers0