knowing the network operator name

2019-08-05 08:16发布

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条回答
霸刀☆藐视天下
2楼-- · 2019-08-05 09:06

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()
查看更多
登录 后发表回答