从Android应用程序获取设备的MAC地址和IP地址[重复]

Posted

技术标签:

【中文标题】从Android应用程序获取设备的MAC地址和IP地址[重复]【英文标题】:Getting the MAC address and IP address of device from Android app [duplicate] 【发布时间】:2015-01-23 13:20:27 【问题描述】:

如何从 android 应用程序中获取设备的 MAC 和 IP 地址?

【问题讨论】:

【参考方案1】:
 public static String getMacAddr(Context appContext) 
    WifiManager manager=(WifiManager) appContext.getSystemService(Context.WIFI_SERVICE);
    WifiInfo info=manager.getConnectionInfo();
    String m_macAddr=info.getMacAddress();
    return m_macAddr;

试试这个。

【讨论】:

以上是关于从Android应用程序获取设备的MAC地址和IP地址[重复]的主要内容,如果未能解决你的问题,请参考以下文章