posted 14 years ago
I'm a recent Android developer. I have an app that I'd like to work in the background, going to "sleep" for most hours each day and, at other times, checking for server state every 1 hour and, over a brief period of just a few hours, every 10 minutes or so. If there were a change in state, it might display some notice of this (a Toast or something else appropriate).
I've pored over myriad posts and discussions about how "evil" background apps are on Android. There are even apps created to help the device owner manage, especially, kill them. I certainly do not want my app to do the wrong thing.
I have also read that the Android OS will actually kill apps that aren't in active use. My app would probably be asleep from late evening until early to mid-afternoon knowing that there would be no server state to be concerned about until then. Would it not therefore be tossed out and no longer in the background?
I'm interested in a link to an authoritative article that covers the best practice for such things and, if possible, good design for them as well. Alternatively, my ears are wide-open if someone wanted to pontificate directly here. I would be most grateful for any and all comments.
Thanks,
Russ Bateman