title: Using Timer.scheduleAtFixedRate() in Android
body: <p>In my Android app, I need a certain bit of code to execute every minute, whether the phone is active or not.</p>
  
  <p>(For those curious, the app is meant for a personal project, a "talking" clock which will need to check every minute if that time has a corresponding sound file to play. It's not something I plan to release to the world, so battery considerations are not in play.)</p>
  
  <p>My current approach is to use <code>Timer.scheduleAtFixedRate()</code> to schedule a task.</p>
  
  <p>This seems to work whenever I am looking at the app, and interacting with it occasionally to keep the screen from blanking, but if the phone turns the screen off to save power, it seems like my call happens sporadically.</p>
  
  <p>I tried setting the interval to be every 30 seconds, but even then it seems like I miss some minutes. Are there specific considerations to using Timer on Android? Is there a better way to achieve what I need?</p>