`

Android 手机制式和网络类型 GSM/EDGE/CDMA/WCDMA 判断sim卡类型 sim/uim/usim

阅读更多

android 手机制式和网络类型 GSM/EDGE/CDMA/WCDMA 判断sim卡类型 sim/uim/usim

这里我们再来熟悉一下TelephonyManager ,通过它来完成网络类型和手机卡制式的判断。   

//获得SIMType   

String simType = "unknown";

 

//获得系统服务,从而取得sim数据   

TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); //获得手机SIMType   

 

int type = tm.getNetworkType();   

//判断类型值,并且命名  

 

if (type == TelephonyManager.NETWORK_TYPE_UMTS) {   

simType = "USIM";

//类型为UMTS定义为wcdma的USIM卡   

} else if (type == TelephonyManager.NETWORK_TYPE_GPRS ) {   

simType = " SIM";//类型为GPRS定义为GPRS的SIM卡   

}else if (

type == TelephonyManager.NETWORK_TYPE_EDGE) {   

simType = " SIM";

//类型为EDGE定义为EDGE的SIM卡   

}else{   

simType = " UIM";

//类型为unknown定义为cdma的UIM卡   

}

 

转自 http://www.cnmsdn.com/html/201004/1271952196ID4175.html

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics