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

2

5

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.

Burundi answered 6/1, 2010 at 7:45 Comment(0)
W
8

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.

Warnock answered 15/9, 2010 at 18:36 Comment(0)
O
1

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 !

Oxymoron answered 6/1, 2010 at 9:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.