Android provides the following method to determine the network operator: http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName()
However even the documentation specifically says:
Returns the alphabetic name of current registered operator. Availability: Only when user is registered to a network. Result may be unreliable on CDMA networks (use getPhoneType() to determine if on a CDMA network).
The problem is that we need a reliable way to detect the carrier so we can identify the traffic source. Has anyone had a similar problem and if so, what is the best solution?
My phone is on Verizon Wireless. On a daily basis, I drive through areas where my phone is roaming and/or has poor reception. Using scripting layer for android, I will log the results of calling getOperatorName() once every ten minutes over the next week.
There is another method that might work in the android.telephony.cdma api. The documentation there is missing the reliability disclaimer. You would only get a Network ID instead of a name. Unfortunately, this requires API level 5 instead of 1 if that matters to you.
Logging the results of the getOperatorName() method yielded nothing special. When I had no service it consistently returned null and when I had service it consistently returned "Verizon Wireless." I'm sure that's not very helpful.
Edit: Addition and correction. Added - Explanation of link Corrected - API level 5 not 17
Edit 2: Test results
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With