Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?

like image 240
kakopappa Avatar asked Apr 19 '11 11:04

kakopappa


2 Answers

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)

like image 149
RoflcoptrException Avatar answered Sep 21 '22 12:09

RoflcoptrException


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.

like image 23
Glenn Avatar answered Sep 22 '22 12:09

Glenn