I have an app that tries to determine the quality of the mobile network in various locations, and then associate it with which network is in use on the phone.
To get the mobile carrier, I am using
TelephonyManager manager = (TelephonyManager)mContext.getSystemService(
Context.TELEPHONY_SERVICE);
String carrierName = manager.getNetworkOperatorName();
This generally works, but in some cases, I get the result, "Fi Network". Since Google Fi switches between T-Mobile, Sprint and US Celluar in the United States, I'd like to know which of the actual carriers is used, so I can use it to determine the quality of the network.
Is there any API that can tell me which of these carriers the phone is actually using?
TelephonyManager.getSimOperator()
will return MCC & MNC codes which should uniquely identify a carrier, you can easily find lists online that maps MCC+MNC to operators names.