For my current private coding@home project I was looking at how to schedule alarms on Android.
I quickly realized that the AlamManager was what I was looking for. I followed one of the many resources found on the net and started to implement a simple test application. One of those pages explaining how to deal with AlarmManager and WakeLocks is http://www.androidguys.com/2009/04/02/wake-up-with-the-alarm/.
Everything was fine and it instantly worked. BUT! I wanted to see if it will also work when my app is stopped (e.g. when Android runs out of memory it will stop apps that are still running in the background). To make it easy I took one of those task killer apps you can find in the Android market. I killed my app after the alarm was set and ..... the alarm never got off.
I was really disappointed and was looking for a solution. I also had a look or two at the built-in Alarm Clock app. I did everything like it was done there. And still it wasn't working.
Then I tried what happens to the Alarm Clock when I create an alarm and kill the app. And what happened? Exactly the same. I couldn't believe what I had seen.
After some googling I found that the real problem wasn't the alarm stuff but the task killer itself. ( see http://groups.google.com/group/android-developers/browse_thread/thread/3f87972d1f99ee81?pli=1 )
I really wasn't aware that using a task killer on Android is so aggressive. By definition it means killing also the alarms registered by the app (and everything else).
Now I know better and don't use that task killer app so much as I did before because now I can imagine how much can go wrong when using those kind of apps. (And now I know why there is no such app preinstalled on the device.)
Subscribe to: Post Comments (Atom)
Post a Comment