获取sim卡运营商
来源:互联网 发布:詹姆斯力量数据 编辑:程序博客网 时间:2024/05/01 04:00
import android.content.Context;import android.telephony.TelephonyManager;/** * sim卡信息工具类,主要用来获取sim卡对应的imsi,以及判断移动客户所属网络运营商 */public class IMSIUtil { private static final String TAG = IMSIUtil.class.getSimpleName(); /* * 标识移动客户所属移动网络 * */ public static final int NETWORK_UNKNOW = -1; //未知运营商 public static final int NETWORK_CHINA_MOBILE = 0; //中国移动 public static final int NETWORK_CHINA_UNICOM = 1; //中国联通 public static final int NETWORK_CHINA_TELECOM = 2; //中国电信 /** * 获取手机卡对应的imsi * @param context * @return */ public static String getIMSI(Context context) { TelephonyManager manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); return manager.getSubscriberId(); } /** * 获取移动客户所属移动网络 * @param context * @return */ public static int getNetwork(Context context) { TelephonyManager manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); String imsi = manager.getSubscriberId(); if(imsi !=null) { if(imsi.startsWith("46000") || imsi.startsWith("46002")) { //中国移动 return NETWORK_CHINA_MOBILE; } else if(imsi.startsWith("46001")) { //中国联通 return NETWORK_CHINA_UNICOM; } else if(imsi.startsWith("46003")) { //中国电信 return NETWORK_CHINA_TELECOM; } else { //未知运营商 return NETWORK_UNKNOW; } } return NETWORK_UNKNOW; }}
- 获取sim卡运营商
- Sim 卡运营商获取
- Android 获取SIM卡运营商
- Android 获取SIM卡运营商 .
- SIM 卡获取运营商信息
- android 获取sim卡运营商信息
- android 获取sim卡运营商信息(转)
- android 获取sim卡运营商信息
- android 获取sim卡运营商信息(转)
- 安全退出应用+ 获取sim卡运营商
- Android 获取手机SIM卡运营商
- android 获取sim卡运营商信息
- android 获取sim卡运营商信息(转)
- 根据手机sim卡获取运营商信息
- android 获取sim卡运营商信息
- android 获取sim卡运营商信息 .
- SIM卡运营商信息整理
- iOS 获取手机sim卡的运营商(移动,电信,联通) 相关信息
- 仿三星解锁
- Architecture of the TCG Software Stack
- 苹果iOS和Android的结合体!多图赏析Firefox OS
- Blendshape模型生成法线图
- 《一》Android 数据库 SQlite SQLiteOpenHelper
- 获取sim卡运营商
- [iOS]delegate和protocol
- 在treeWidget中加入控件
- ubuntu 修改默认语言方法
- 绩效主义毁了索尼
- (转载)QListWidget类
- 面试中的Singleton
- C mysql编译链接问题
- android中一个activity实现多个xml页面互换。