android 获取通讯模块制式类型

public String getPhoneType(Context context, int simId) {
int phoneType = MultiSIMDeviceInfo.getInstance(context).getPhoneType(GEMINI_SIM_1);
if(phoneType == TelephonyManager.PHONE_TYPE_NONE){
TelephonyManager tm = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
phoneType = tm.getPhoneType();
}
String phoneTypeString=null;
switch(phoneType){
case TelephonyManager.PHONE_TYPE_NONE:
phoneTypeString = "NONE";
break;
case TelephonyManager.PHONE_TYPE_GSM:
phoneTypeString = "GSM";
break;
case TelephonyManager.PHONE_TYPE_CDMA:
phoneTypeString = "CDMA";
break;
}
return phoneTypeString;
}

你可能感兴趣的:(android,String,service,通讯)