/**
* 获取手机mac地址<br/>
* 错误返回12个0
*/
public static String getMacAddress(Context context) {
// 获取mac地址:
String macAddress = "000000000000";
try {
WifiManager wifiMgr = (WifiManager) context
.getSystemService(Context.WIFI_SERVICE);
WifiInfo info = (null == wifiMgr ? null : wifiMgr
.getConnectionInfo());
if (null != info) {
if (!TextUtils.isEmpty(info.getMacAddress()))
macAddress = info.getMacAddress().replace(":", "");
else
return macAddress;
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return macAddress;
}
return macAddress;
}
获取手机名称
android.os.Build.MANUFACTURER