获取手机IMEI值

public String getImei() {
		TelephonyManager telephonyMgr = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
		String imei = telephonyMgr.getDeviceId();
		if (imei != null) {
			if (imei.length() > 8) {
				imei = imei.substring(imei.length() - 8);
			}
			return imei;
		}
		return "无法获取手机IMEI值";
	}

猜你喜欢

转载自gintama.iteye.com/blog/1763079