title: Android - Having a service run every day at 4AM
body: <p>I would like to know the best practices for running a Service every day at 4AM.</p>
  
  <p>The way I <em>think</em> 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.  </p>
  
  <p>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?</p>
  
  <p>Any help with these questions would be much appreciated :)  Sample code would be helpful as well!</p>
  
  <p>Bara</p>