title: Android AlarmManager or Service?
body: <p>I have an application, that has a main.java file that sets up an alarm to call a recurring service. However when I close the application the service is no longer called for some weird reason. So I was reading around what I should be doing for my application (basically what I want is something like Twicca, where the twitter app continues to run even if you close it from your "task manager"). And it looks like what I need to do is deploy my entire application as a service, so that it will keep running indefinitely unless the system closes it. Is this what I should be doing? Or is there a more appropriate way to do this?</p>
  
  <p>I was reading around SO and found a question which linked me to this - <a href="http://android-codes-examples.blogspot.com/2011/11/running-service-in-background-on.html?m=1" rel="nofollow">http://android-codes-examples.blogspot.com/2011/11/running-service-in-background-on.html?m=1</a> - is that what I should be doing? It seems that in that example basically the user closes the application but it continues to run as a service in the background, correct?</p>
  
  <p>For reference here are my files:</p>
  
  <p>MainActivity.java</p>
  
  <p><a href="https://gist.github.com/4414275" rel="nofollow">https://gist.github.com/4414275</a></p>
  
  <p>RepeatingAlarm.java</p>
  
  <p><a href="https://gist.github.com/4414277" rel="nofollow">https://gist.github.com/4414277</a></p>
  
  <p>I have it set up correctly in my manifest since the alarm is behaving as it should be here is that file to.</p>
  
  <p><a href="https://gist.github.com/4414285" rel="nofollow">https://gist.github.com/4414285</a></p>