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

爱⌒轻易说出口 提交于 2019-11-29 10:58:53

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.

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 !

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!