title: Best way to have an Android app poll periodically in the background
body: <p>Take the Gmail app as an example.  Whether the phone is on or not, it polls every 10 minutes or so to download new emails which may have arrived since you last checked.</p>
  
  <p>I know how to create a new service and bind to it.  But I can see a few ways to accomplish this:</p>
  
  <ul>
  <li>Bind once, and have the service run in an infinite loop, sleeping for 10 minutes between each loop</li>
  <li>Bind and unbind right when it's done, scheduling the next bind somehow in 10 minutes</li>
  <li>Using the AlarmManager class to schedule future polls</li>
  </ul>
  
  <p>What are the trade offs?   How does the Gmail app accomplish it?</p>
  
  <p>Thanks!</p>