#if JAVA
import java.net.NetworkInterface;
import java.util.Collections;
import java.util.List;
public static String getWifiMacAddress() {
try {
String interfaceName = "wlan0";
List<NetworkInterface> interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());
for (NetworkInterface intf : interfaces) {
BA.Log("" + intf);
byte[] mac = intf.getHardwareAddress();
if (mac==null){
continue;
}
StringBuilder buf = new StringBuilder();
for (byte aMac : mac) {
buf.append(String.format("%02X:", aMac));
}
if (buf.length()>0) {
buf.deleteCharAt(buf.length() - 1);
}
BA.Log(buf.toString());
}
} catch (Exception ex) {
ex.printStackTrace();
}
return "";
}
#end if