Get android Ethernet MAC Address (not wifi interface)

后端 未结 8 1912
南旧
南旧 2021-02-05 12:12

I\'m using Android with Api level 8 and I want to get the Address of my Ethernet interface (eth0).

On API level 8, the NetworkInterface class don\'t have the function ge

8条回答
  •  眼角桃花
    2021-02-05 12:34

    Maybe my answer will be helpful to a few of you out there, and at least funny for the rest of you.

    I was trying to get the ethernet MAC address for an Android TV device, to try to find the actual manufacturer the MAC address is registered to. I connected to the device with adb and used Joel F's great answer above and it worked great.

    Then I flipped the box over and there it is on a sticker on the bottom of the device.

    So if you don't need it programatically, try flipping the device over first.

    P.S. I contacted the manufacturer the address is registered to, and they said they don't make this model and that other manufacturers copy their MAC addresses.

提交回复
热议问题