public String getLocalMacAddressFromIp() {
String mac_ip = "";
try {
byte[] mac;
NetworkInterface ne =
NetworkInterface.getByInetAddress(
InetAddress.getByName(
getLocalIpAddress()));
mac = ne.getHardwareAddress();
mac_ip = byte2hex(mac);
} catch (Exception e) {
e.printStackTrace();
}
if(TextUtils.isEmpty(mac_ip)){//解决小米手机无法获取mobileID
mac_ip=getMacFromHardware().toLowerCase();
}
return mac_ip;
}