How to detect tower changes in Android?

元气小坏坏 提交于 2019-11-30 08:37:46

问题


Just wanted to know whether it's possible to get cell tower changes in Android?

I have seen an event called onCellLocationChanged in PhoneStateListener.

Can I use this to detect cell tower changes ?


回答1:


This is the correct method. It is always called if you are in a new cell. See the documentation here:

http://developer.android.com/reference/android/telephony/PhoneStateListener.html#onCellLocationChanged(android.telephony.CellLocation)




回答2:


This is not true. onCellLocationChanges from PhoneStateListener is ONLY called when the phone is NOT sleeping. You have to wake up the phone (force a wakelock) - to get cell info.



来源:https://stackoverflow.com/questions/5715427/how-to-detect-tower-changes-in-android

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