Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android How to identify carrier on CDMA network?

Tags:

android

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?

like image 549
rbanikaz Avatar asked Nov 10 '11 23:11

rbanikaz


1 Answers

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

like image 90
M. Betzer Avatar answered Oct 19 '22 09:10

M. Betzer