【问题标题】:How to get MAC(Hardware) address in android programmatically. Not using Bluetooth or Wi-fi如何以编程方式在 android 中获取 MAC(硬件)地址。不使用蓝牙或 Wi-Fi
【发布时间】:2014-06-25 11:42:09
【问题描述】:

我想在我的 android 手机上获取我的 mac 地址,而不使用 Wi-fi 或蓝牙,在 android 中以编程方式。

我该怎么做?

【问题讨论】:

    标签: android mac-address


    【解决方案1】:
    WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
    WifiInfo wInfo = wifiManager.getConnectionInfo();
    String macAddress = wInfo.getMacAddress(); 
    

    别忘了为 ACCESS_WIFI_STATE 添加权限

    【讨论】:

    猜你喜欢
    • 2016-01-11
    • 1970-01-01
    • 1970-01-01
    • 2018-06-12
    • 2014-10-28
    • 1970-01-01
    • 2022-06-13
    • 2014-06-22
    • 2011-03-14
    相关资源
    最近更新 更多