In my Android application, I want to run some form of a background process, which checks a few conditions every 10 minutes. If a condition is satisfied, I want to show an AlertDialog box or some form of notification to the user.
How can I do this? Can anyone provide some source code as a reference point?
I have tried running a new Thread in the Activity onCreate() method, but wasn’t able to get too far with that.
Thanks!
I would use a IntentService with AlarmManager, to call it every X minutes.
The reasons I would suggest that, and not using a background thread that sleeps for 10 minutes each time, are two: