如何在Android中找到运营商的名称

fhu*_*cho 77 android

如何在Android中找到运营商的名称?

pab*_*leu 130

从来没有使用它,但看看TelephonyManager-> getNetworkOperatorName().

您可以尝试这样简单的事情:

TelephonyManager manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
String carrierName = manager.getNetworkOperatorName();
Run Code Online (Sandbox Code Playgroud)

  • 如果没有网络,它将返回**空**字符串 (9认同)
  • @pableu如果我使用双卡移动手段,我怎样才能获得这两个运营商名称? (4认同)
  • 漫游怎么样? (3认同)
  • 这需要特定的许可吗? (2认同)

fhu*_*cho 25

TelephonyManager telephonyManager = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE));
String operatorName = telephonyManager.getNetworkOperatorName();
Run Code Online (Sandbox Code Playgroud)


vel*_*val 11

如果需要运营商的运营商名称,如通知栏上显示的那样@Waza_Be询问.可以使用getSimOperatorName方法,因为几个电信公司将其网络转租给其他公司.

TelephonyManager telephonyManager = ((TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE));
String simOperatorName = telephonyManager.getSimOperatorName();
Run Code Online (Sandbox Code Playgroud)

  • 嗨@SrishtiRoy,似乎只需要API级别22及以上版本支持您所需要的内容.检查已接受答案的评论[here:](http://stackoverflow.com/questions/22170425/get-operator-details-for-dual-sim-android-phone).Android docs [here](https://developer.android.com/reference/android/telephony/SubscriptionManager.html#getActiveSubscriptionInfoList%28%29) (2认同)