Android: Why are methods for getting neighboring cell signal strengths better than those for current cell signal strength?

I'm writing an android application that collects cell signal strengths. I am having trouble getting the "current" cell signal strength, but I don't have any problem getting the "neighboring" cell signal strengths.

To get the current cell signal strength, I created a PhoneStateListener and implemented the onSignalStrengthChanged callback. It works, but not very well. It seems like the signal strength hardly ever changes, and resolution jumps to only a few numbers. I would accept the answer that the resolution of the signal strength hardware is coarse, but when I use the TelephonyManager's getNeighboringCellInfo() method, it works much better. The signal strength readings from neighboring cells change frequently, and they have much better resolution.

So, how can I get the current cell signal strength in the same way that I am getting the neighboring cell strengths? It seems odd to me that the functionality of the neighboring cells is better than the current cell. Am I missing something here?

I would also like to directly call a method from the telephony manager to get current cell strength, as opposed to a listener, if possible. If anyone knows how, please let me know. Thanks.


Asked by: Tara196 | Posted: 25-01-2022






Answer 1

Based on Android 1.5 sources (BatteryStatsImpl.java) notification is being sent only if signal changes between following states:

SIGNAL_STRENGTH_NONE_OR_UNKNOWN (99)
SIGNAL_STRENGTH_GREAT (16-32)
SIGNAL_STRENGTH_GOOD (8-15)
SIGNAL_STRENGTH_MODERATE (4-7)
SIGNAL_STRENGTH_POOR (0-3)

So in your case signal strength changes within the same range and you don't receive notifications.

I guess it is done this way to save battery life.

Answered by: Joyce922 | Posted: 26-02-2022



Answer 2

I think this method is not working very well because as written in the javadoc, onSignalStrengthChanged() is deprecated since api 2.0, and replaced by onSignalStrengthsChanged() (note the "s"), but unfortunatly this method is private !

There is an open issue about that, it seems google has removed the method for unknow reason (maybe because its not working well as you have noticed it), and it will be available in a next sdk release.

You just have to be patient then and vote here to speed up dev process !

Answered by: Brooke935 | Posted: 26-02-2022



Similar questions

Android neighboring cells info

I am using Samsung Ace S5830 phone running on Android 2.2 I am facing a problem that when i try to get neighboring cell information it returns me an empty list. but when i get in the service mode of the phone with the code ##197328640## and then click on neighboring cells it shows me the cell information. Can anyone tell me why i am not able to get the neighboring cell information through...


Get neighboring cell in Android returns null

I'm trying to get the neighbouring cell info in Android but the function getNeighboringCellInfo() always return null. I used the following code : protected void getCellInfo() { TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); List<NeighboringCellInfo> neighborCells = telephonyManager.getNeighboringCellInfo(); ...


location - cellID and LAC / PSC for 3G neighboring cells in Android

I am trying to identify the neighboring cells location in 3G with Android, which I get with getNeighboringCellInfo(). When The phone works in GSM mode, I am able to use getCid() and getLac() to get the CellID and the LAC, but for 3G, I can only use getPsc(), which I'm not very sure if it's enough to identify a cell. Can anybody please tell me if I can get the CellID + LAC for neighboring cells? And if that's not po...


android - How to get info about the neighboring cells using 3G networks

i'm trying to get info about the nearby neighboring cells. it's correct using 2G networks,but i get '-1' for lac and cid. Is there anything i can do to make it work on 3G networks? infoList = new ArrayList<CellInfo>(); CellInfo cellInfo = null; List<NeighboringCellInfo> infos = tm.getNeighboringCellInfo(); for(NeighboringCellInfo info : infos){ cellInfo = new CellInfo(); cellIn...


Getting neighboring cells information using android Samsung galaxy smartphones

My target is to get all neighboring cell towers information like cell id, cell lac and RSS values, I used the class telephonyManager.getNeighboringCellInfo() to get required information but it return null every time. But, I succeeded to get the nearest single cell tower information which connected to mobile (i.e serving cell) using telephonyManager.getCellLocation(). I tried to fix...


android - Get Neighboring Cell Information From ServiceMode Samsung

I tried getting neighboring cell signal strengths like this: Getting CID, LAC and signal strength of all cell towers in range -- however this doesn't seem to be supported with most Samsung phones (just returns blank list). I get a similar result when I run the "GSM Signal Monitoring" app -- no nearby c...


java - What phones ( on Android, of course) are able to correctly display the CID for the neighboring cell towers in 3g, 4g?

Tell me, please , what phones ( on Android, of course) are able to correctly display the CID for the neighboring cell towers for 3g and 4g. I mean, I tried to get this information on the Sony Z3 and Samsung S5, however, they give incorrect data.


c# - Trouble with RayCasting to check neighboring blocks for a specific state

Sorry for the long question. I am making a simple game where you click a cube and it changes its material to a certain color(i.e. dirt/grass >> water and any dirt "tiles" next to the water tile(cardinally) will automatically become yellow). These colors are kept by using an int value to identify the state. I failed at using an 2d array in c# to store these cubes so I was attempting to use raycasting to check for th...


Android: Refreshing listView of neighboring tab inside Viewpager not working

I have a viewpager with many tabs in my app. From one of the tabs (say A) I want to change the listView in the neighboring tab (say B). The tab B has an adapter that extends ArrayAdapter. This is what I am doing. In Tab A ParentFragment parentFragment = (ParentFragment)getParentFragment(); List<Fragment> fragmentList = parentFragment.getChildFragmentManager().getFragments(); for (Fragment frag...


How to get Neighboring Cell Info in android Q?

I am upgrading support of my application to Android Q but from updated SDK there is no such method like getNeighboringCellInfo() available in TelephonyManager class https://developer.android.com/reference/android/telephony/TelephonyManager.html is there any way to get Neighboring Cell Info? Thanks...






Still can't find your answer? Check out these communities...



Android Google Support | Android Community | Android Community (Facebook) | Dev.io Android



top