Getting the MAC address and IP address of device from Android app

2.2k Views Asked by At

How can I obtain the MAC and IP addresses of the device from an Android application?

1

There are 1 best solutions below

0
On
 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;
}
  • Try this.