Sorry, long ranting post. Summary:
- Does Android have a low battery alarm (besides the useless silent popup)? - If not, are there apps to add one? (good ones, that don't themselves drain the battery?) - If not, are "ACTION_BATTERY_CHANGED" intents the best way to monitor for battery drain? - Does Android really put the CPU to sleep when you lock the phone? - Otherwise, how does it decide when to put the CPU to sleep? - How does this CPU sleep affect "naive" simple services? - How does this CPU sleep affect broadcasted intents such as "ACTION_BATTERY_CHANGED" and "ACTION_TIME_TICK"? - Can a service "schedule" itself to cause no battery drain for, say, 30 minutes, wake up and do something for a second, and sleep for 30 minutes again (and does this effectively equal zero drain on the battery?) -------- I recently aquired a Samsung Galaxy i7500 (from Germany, via a mailbox/ shipping company) and have been playing with and developing on it for a couple of weeks. Several times, the phone has run out of batteries and turned off, but until today I didn't have proof - there is NO AUDIBLE WARNING that the phone is running out of battery - how is this possible?? I've tried to search to see whether this is a problem with my phone specifically, or android overall, but have not found anything useful. Lots of people complain that their (non-android) phones make noise and want to turn it off, but almost no android users seem to have any feedback either way. The one android user that I found complaining (besides the usual battery drain complaints) was actually saying that her phone had recently STARTED making noise when it ran low, and that she wanted to stop it: http://androidforums.com/support/4815-low-battery-tone.html I found a relevant query that was apparently posed to the android- beginners list, but I can't find it in google groups... (and there was no linked answer in the OSDir thread I found): http://osdir.com/ml/AndroidBeginners/2009-04/msg00241.html Assuming that this is simply a flaw in the OS (on the Galaxy I'm running Cupcake/1.5 standard with Google APIs, haven't tried rooting it yet), I guess the only solution would be to write a service that somehow monitors the battery level and does something when it start running low. In an (unrelated, location-based) application I'm writing now I use the "ACTION_BATTERY_CHANGED" Intent Action with a BroadcastListener to find out if the battery is running low (and quit doing expensive GPS stuff if that is the case), and that is, or at least seems to be, a very easy solution... Does anyone know what the CPU drain related to running a service in this manner would be? Is this a completely stupid approach? Is there a better way? (has it already been done and I just can't find the damned application?) I recently saw an interesting (and slightly perplexing) thread that could be related: http://groups.google.com/group/android-developers/browse_thread/thread/af4cbad961a9044b/8a6d0b61dce5ea0a?lnk=gst&q=low+battery#8a6d0b61dce5ea0a If I'm understanding correctly, even if I ran a service that I didn't quit, it would somehow be put to sleep (until the user did something to wake up the CPU) unless I did something clever with CPU Wake locks? That would be good for the CPU, but clearly not very good for the Low Battery alarm I'm trying to set up (or find)... Is the "correct" approach a combination of the two? - Service - running all the time - When the phone is awake / active: - checks battery status (or listens for "ACTION_BATTERY_CHANGED" intents for a couple minutes) every 5 minutes. - when the phone is asleep: voluntarily puts itself to sleep for 30 minutes at a time, listens for "ACTION_BATTERY_CHANGED" intents for a few minutes, and goes to sleep again. I'm not sure even this makes any sense of course, because if the CPU really shuts down when the user is not doing anything at all with the phone for extended periods of time, then how would it be sending these "ACTION_BATTERY_CHANGED" intents anyway??? Sorry for the long post, but I seem to be reaching beyond the point where mere exploration and search is going to help... (this is where someone is going to point me to the secret low battery alarm setting in the UI ;) hah, I would be delighted!) Thanks for your time, Tao --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

