knowing the network operator name

拜拜、爱过 提交于 2019-12-11 10:05:47

问题


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.


回答1:


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()


来源:https://stackoverflow.com/questions/6570751/knowing-the-network-operator-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!