I am writing an alarm program for android and am very happy with it so far. But I have a big concern about how to make sure it keeps running constantly. I.e. I don't want the OS to kill it to free up memory (I'd like the OS to kill other apps first) and I want to ensure that the program starts up again if the user powers down and up again. How can I achieve this?
Asked
Active
Viewed 278 times
1 Answers
1
Simple: You make sure that it doesn't run constantly. You're not supposed to. Not even with a service. There is a reason Android is trying to kill your process, you shouldn't try to work around it. If you're working on an alarm program, better take a look at AlarmManager instead.

Timo Ohr
- 7,947
- 2
- 30
- 20