Get android Ethernet MAC Address (not wifi interface)

后端 未结 8 1752
南旧
南旧 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:42

    Many implementations of AndroidTV may have it populated in property, you could check with getprop command to find the correct property name ad then read it using SystemProperties.get()

    for reading the MAC in the program in java you could use something like following

    SystemProperties.get("ro.boot.ethernet-mac");
    

提交回复
热议问题