aaaa wrote:
> I'm trying to log the phone's cell movement. So I created a
> PhoneStateListener that is being called when the CellLocation has been
> changed. Then it informs a logging service to write that new cell
> information to a log file.
> 
> This works as long as the screen is on. But when the screen goes off,
> the logging stops.

Correct.

> The PhoneStateListener gets loaded on boot time
> public class CellStateListener extends PhoneStateListener {
>   public void onCellLocationChanged(CellLocation location) {
>     ...
>     //this is the logging service which is informed when the cell
> location changes
>     listener.onCellChanged(mcc, mnc, lac, cid);
>     ...
>   }
> }

If you are doing this from a BroadcastReceiver, that is fairly evil.

> I tried to use the PowerManager to set a PARTIAL_WAKE_LOCK in my
> logging service. But this doesn't work.

You may be using the WakeLock incorrectly, then. My guess, from your
symptoms, is that the device is falling asleep, which is why you are not
detecting new cell location updates.

Bear in mind, though, that permanently holding a WakeLock, so you can
find out about cell location updates, will mean the CPU never stops, and
your users will be inclined to beat you about the head with a tire iron
due to the vastly reduced battery life.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Development Wiki: http://wiki.andmob.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to