Hello everyone,
I would like to know the best practices for running a Service every day at 4AM.
The way I think I should be doing it is to create a new repeating alarm using AlarmManager and having it run the service at 4AM. Problem is, I'm not sure where to put the code to set the alarm.
Do I do it in my main activity as one of the first tasks in the OnCreate method? Do I do some funky stuff with BroadcastReceivers and intents? What happens when a user updates my app? What happens when a user restarts?
Any help with these questions would be much appreciated :) Sample code would be helpful as well!
Bara