-1

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

DavidRR
  • 16,676
  • 19
  • 101
  • 178

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
  • 332
  • 5
  • 23