PHP
·
发表于 5年以前
·
阅读量:8391
public static String getMacAddress(Context context) {
String macAddress;
WifiManager wifi = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
WifiInfo info = wifi.getConnectionInfo();
macAddress = info.getMacAddress();
if ( null == macAddress) {
return "" ;
}
macAddress = macAddress.replace( ":" , "" );
return macAddress;
}