如何识别SIM卡的类型?

时间:2012-03-07 04:29:19

标签: android sim-card

我正在开发一个应用程序,我需要根据需要执行调用来检查类型SIM。我能够获得网络类型,但我无法获得他正在使用的SIM卡类型。

3 个答案:

答案 0 :(得分:2)

老兄用这个

        TelephonyManager telephone = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
        String sim_nul = telephone.getSimSerialNumber();
        String op_name = telephone.getNetworkOperatorName();

在这里,您将获得 Sim号以及像运营商这样的名称。

答案 1 :(得分: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();

答案 2 :(得分: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   

}