Android How to determine the carrier in a CDMA network?

Android provides the following method for determining the network operator: http://developer.android.com/reference/android/telephony/TelephonyManager.html#getNetworkOperatorName ()

However, even the documentation specifically states:

Returns the alphabetical name of the current registered operator. Availability: only when the user is registered on the network. The result may not be reliable on CDMA networks (use getPhoneType () to determine if there is a CDMA network).

The problem is that we need a reliable way to detect the media so that we can identify the source of the traffic. Someone had a similar problem, and if so, what is the best solution?

+6
source share
3 answers

My phone is on Verizon Wireless. Every day I drive through areas where my phone is roaming and / or has poor reception. Using the scripting level for android, I will record the results of calling getOperatorName () once every ten minutes over the next week.

There is another method that can work in android.telephony.cdma api. There is no disclaimer in the documentation. You would get a network id instead of a name. Unfortunately, this requires an API level of 5 instead of 1 if that is important to you.

Recording the results of the getOperatorName () method did not bring anything special. When I did not have a service, it invariably returned to zero, and when I had a service, it consistently returned "Verizon Wireless". I am sure this is not very useful.

Edit: add and fix. Added - Link explanation Fixed - API level 5 is not 17

Edit 2: Test Results

+2
source

I am currently looking for a solution to this problem. According to this thread, you can use CdmaCellLocation.getNetworkId and CdmaCellLocation.getSystemId . Since there are no CDMA networks in Germany, I cannot check if this works ...

0
source

You think maybe this was one preview product for Google supporting cdma? Play within or find another playground - this is what I hear from Google. It’s good that the fact that the host applications burned in Roma sometimes left gaping holes in safety. As for the possible answer to your question ... where can you get the information from? APN parameters can tell you or approve a known operator line in build.prop to pull out information that I might need, for example. (I make my favorite roms). Again, if you physically check the phone, the carrier is usually branded;) From what advantage do you extract information?

Rob

-1
source

Source: https://habr.com/ru/post/901259/


All Articles