looped execution of code snippet even when the application is in background?
I am developing a app in android .... which need a code snippet to be executed in a loop... i thought of using 开发者_JS百科threads and handler.. i need some assistance on that...
and is there any other optimistic way of doing it...
consider it like an alarm clock, where the program continually checks for the alarm time with the mobile time ... i need to implement a concept similar to this ...
pls help me out guys ... Thanks :) :)
If you want to make something like an alarm clock where something will happen at a specific time then you want to be using the built in AlarmManager. It will let you pass an PendingIntent to it so that your program runs at the specific time
You should create a Service... and your app will use it.. like this, even if your app is garbaged, your service can still run.
精彩评论