androidcellular-network

How to detect tower changes in Android?


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 ?


Solution

  • 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)

    Update: November 2022

    This class was deprecated in API level 31. Use TelephonyCallback instead.