我正在开发一个应用程序,我需要根据我需要执行呼叫来检查 SIM 类型。我能够获取网络类型,但无法获取他正在使用的 SIM 类型。
问问题
4213 次
3 回答
2
老哥用这个
TelephonyManager telephone = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
String sim_nul = telephone.getSimSerialNumber();
String op_name = telephone.getNetworkOperatorName();
在这里,您将获得Sim 号码以及运营商名称,例如 Vodafone 等。
于 2012-03-07T04:37:44.120 回答
2
final TelephonyManagertm(TelephonyManager)getBaseContext().getSystemService
(Context.TELEPHONY_SERVICE);
String deviceid = tm.getDeviceId();
String sim_operatorname=tm.getSimOperatorName();
String sim_number=tm.getSimSerialNumber();
String manufacturer_name =Build.MANUFACTURER.toString().trim();
于 2012-03-07T04:52:08.233 回答
1
判断sim卡sim/uim/usim的类型:
/ / Get SIMType
The string simType = "unknown";
/ / Get the system, to obtain the sim data
TelephonyManager tm = (TelephonyManager) context.getSystemService (Context.TELEPHONY_SERVICE);
/ / Get the cell phone SIMType
int type = tm.getNetworkType ();
/ / Determine the type of value, and named
if (type == TelephonyManager.NETWORK_TYPE_UMTS) {
simType = "USIM";
/ / Type defined for UMTS USIM card for wcdma
} Else if (type == TelephonyManager.NETWORK_TYPE_GPRS) {
simType = "SIM";
/ / Type defined for GPRS GPRS SIM card
} Else if (
type == TelephonyManager.NETWORK_TYPE_EDGE) {
simType = "SIM";
/ / Type defined for EDGE-EDGE SIM card
} Else {
simType = "UIM";
/ / Type is unknown definition of UIM card for cdma
}
于 2012-03-07T05:40:33.603 回答