> What does the user being idle have to do with anything here? If there is > no work to be done, there is no work to be done, so stop your service > and wake it up after some time to see if there is new work to be done.
Well, I simplified the situation in an attempt to make my post succinct. The app runs in the background and records information including the device's location, but it also has a user interface. What I want to prevent is draining the user's battery when they go inside where there is no GPS signal and forget to turn off the app. There is no point in running when there is no GPS fix and the user is not watching the display. However, if the user is interacting with the app, I want it to continue to run regardless of the lack of a GPS fix, because useful information is still displayed and that information requires continuous background processing. > Power is available on demand via a sticky Intent. The power state information that would be useful is not available as far as I know. Windows Mobile has different power states such as ON, OFF, and USERIDLE. I have not found the equivalent in Android. > WiFi signal strength is available on demand via WifiManager. I don't need this currently. > GSM/CDMA signal strength is available on demand from TelephonyManager. As far as I know, you cannot poll for signal strength and the event is only triggered when the signal strength changes by quite a large amount. Additionally. the event stops being raised when the screen turns off. There is a poll function in the service (I looked through the source), but it is not exposed in the SDK. There is a open feature request related to this. -- 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