Android examples for java.net:Mac Address
get Local Mac Address
import android.content.Context; import android.net.wifi.WifiInfo; import android.net.wifi.WifiManager; public class Main { public static String getLocalMacAddress(Context context) { WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE); if (wifi == null) { return ""; }// ww w . j a v a 2 s . com WifiInfo info = wifi.getConnectionInfo(); if (info == null) { return ""; } return info.getMacAddress(); } }