在android中查找棒棒糖前设备的两个SIM卡的网络名称
我可以通过以下方式获取插槽1中sim卡的运营商名称:在android中查找棒棒糖前设备的两个SIM卡的网络名称,android,telephonymanager,Android,Telephonymanager,我可以通过以下方式获取插槽1中sim卡的运营商名称: TelephonyManager manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE); String carrierName = manager.getNetworkOperatorName(); 自从API版本22可能以来,是否有任何方法可以在插槽2中找到sim卡的操作员名称 对于操作系统大于android 5.2的设备,请尝试以下
TelephonyManager manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
String carrierName = manager.getNetworkOperatorName();
自从API版本22可能以来,是否有任何方法可以在插槽2中找到sim卡的操作员名称 对于操作系统大于android 5.2的设备,请尝试以下代码
List<SubscriptionInfo> subscriptionInfos = SubscriptionManager.from(getApplicationContext()).getActiveSubscriptionInfoList();
for(int i=0; i<subscriptionInfos.size();i++)
{
SubscriptionInfo lsuSubscriptionInfo = subscriptionInfos.get(i);
Log.d(TAG, "getNumber "+ lsuSubscriptionInfo.getNumber());
Log.d(TAG, "network name : "+ lsuSubscriptionInfo.getCarrierName());
Log.d(TAG, "getCountryIso "+ lsuSubscriptionInfo.getCountryIso());
}
List subscriptioninfo=SubscriptionManager.from(getApplicationContext()).getActiveSubscriptionInfo();
对于(int i=0;iI)已通过此链接,但我看到几个应用程序提供了这两个SIM卡的信息。我知道SubscriptionManager,但我需要pre lollipop设备pre lollipop不可能阅读以下内容。有一种方法可能适用于某些设备(特定于供应商)不全是。谢谢,我会看的。但我看到很少有应用程序能同时读取sim卡信息。如果你找到解决方案,请告诉我任何解决方案的人,我也在寻找同样的解决方案