Listing 927 Setting repeating alarms

Available for download on

// Fire an intent exactly every hour if already awake. alarms.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,

60*60*1000, 60*60*1000, elapsedIntent);

// Wakeup and fire an alarm about every hour alarms.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,

60*60*1000, AlarmManager.INTERVAL_DAY, elapsedIntent);

The battery impact of setting regularly repeating alarms can be significant. It is good practice to limit your alarm frequency to the sloivest acceptable rate, wake the device only if necessary, and use the inexact repeating alarm whenever possible.

Mobile Apps Made Easy

Mobile Apps Made Easy

Quick start guide to skyrocket your offline and online business success with mobile apps. If you know anything about mobile devices, you’ve probably heard that famous phrase coined by one of the mobile device’s most prolific creators proclaiming that there’s an app for pretty much everything.

Get My Free Training Guide

Post a comment