-1

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

DavidRR
  • 18,291
  • 25
  • 109
  • 191

1 Answers1

3
 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.
kks
  • 342
  • 5
  • 25