知道网络运营商名称

发布于 2024-11-18 12:06:39 字数 472 浏览 8 评论 0原文

我想在我的应用程序中获取我的网络运营商名称。

我在 TelephonyManager 中使用以下方法来获取此内容:

 TelephonyManager mTeleManager = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
 mTeleManager.getSimOperatorName();
 mTeleManager.getNetworkOperatorName();
 mTeleManager.getSimOperator()

但是我从“getSimOperatorName()”和“getNetworkOperatorName()”中获取空值。 我从这个“getSimOperator()”方法中获取数字代码,但我想知道运算符名称的字母形式。类似“T-Mobile”的 Tmobile 网络。

PL。建议我如何做到这一点。

谢谢。

I want to get my network operator name in my app.

I am using fallowing methods in the TelephonyManager to get this:

 TelephonyManager mTeleManager = (TelephonyManager) getSystemService(TELEPHONY_SERVICE);
 mTeleManager.getSimOperatorName();
 mTeleManager.getNetworkOperatorName();
 mTeleManager.getSimOperator()

But I am getting empty values from the "getSimOperatorName()" and "getNetworkOperatorName()"..
I am getting numeric code from this "getSimOperator()" method, But I want know the alphabetic form of the operator name . Some thing like "T-Mobile" for Tmobile networks.

Pl. suggest me how to do this.

thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独闯女儿国 2024-11-25 12:06:39

您是否在不同的手机/不同的 SIM 卡上尝试过?

根据 TelephonyManager.getLine1Number() 返回 Null

大家好,

对此有一个解释。这实际上不是问题,这两个信息都取决于 SIM 卡上的一些可选字段。因此,如果 SIM 卡没有此类可选字段或运营商将其设置为空,则它可能为空。

问候,

他正在谈论

TelephonyManager.getLine1Number()
TelephonyManager.getSimOperatorName()

Have you tried it on different phones/with different sim cards?

According to TelephonyManager.getLine1Number() returns Null

Hi All,

Here comes an explanation for this. It is not actually an issue, both information depends on some fields on the SIM card that are optional. So it might be empty if the SIM has no such optional fields or if the operator has set it empty.

Regards,

He is talking about

TelephonyManager.getLine1Number()
TelephonyManager.getSimOperatorName()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文