直接上代码:

	/**
	 * 获取SIM卡运营商
	 * 
	 * @param context
	 * @return
	 */
	public static String getOperators(Context context) {
		TelephonyManager tm = (TelephonyManager) context
				.getSystemService(Context.TELEPHONY_SERVICE);
		String operator = null;
		String IMSI = tm.getSubscriberId();
		if (IMSI == null || IMSI.equals("")) {
			return operator;
		}
		if (IMSI.startsWith("46000") || IMSI.startsWith("46002")) {
			operator = "中国移动";
		} else if (IMSI.startsWith("46001")) {
			operator = "中国联通";
		} else if (IMSI.startsWith("46003")) {
			operator = "中国电信";
		}
		return operator;
	}

	/**
	 * 手机型号
	 * 
	 * @return
	 */
	public static String getPhoneModel() {
		return android.os.Build.MODEL;
	}

	/**
	 * 系统版本号
	 * 
	 * @return
	 */
	public static String getSystemVersion() {
		return android.os.Build.VERSION.RELEASE;
	}
权限:



相关文章:

  • 2021-11-14
  • 2021-12-26
  • 2021-12-26
  • 2021-12-15
  • 2021-08-16
  • 2021-11-23
  • 2021-11-23
  • 2021-11-07
猜你喜欢
  • 2021-11-23
  • 2021-08-16
  • 2021-12-26
  • 2021-12-26
  • 2021-11-07
  • 2021-07-13
  • 2021-12-26
  • 2021-09-17
相关资源
相似解决方案