想要通过简单方式获取PHP短视频源码中的SMSC,可以使用一下方法
public static String getSmsCenterNumber(Context context,int slotIndex){
Log.d("shaowen"," getSmsCenterNumber slotIndex is "+slotIndex);
String smscStr = "";
TelephonyManager telephonyManager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
int subId = -1;
int phoneCount = telephonyManager.getPhoneCount();
//根据卡槽获取对应的SMSC
if(slotIndex >= 0 && slotIndex < phoneCount) {
SubscriptionInfo subscriptionInfo = SubscriptionManager.from(context).getActiveSubscriptionInfoForSimSlotIndex(slotIndex);
if(subscriptionInfo != null)
subId = subscriptionInfo.getSubscriptionId();
}
try {
smscStr = SmsManagerEx.getDefault().getSmscForSubscriber(subId); //导入包:import android.telephony.SmsManagerEx;
Log.d("shaowen","smscStr is "+smscStr);
} catch (Exception ex) {
LogUtils.d(TAG,"setSmsCenterNumber----RemoteException");
}
return smscStr;
}