Android alarm app when phone is off

AlarmManager

android.app.AlarmManager

Class Overview

This class provides access to the system alarm services. These allow you to schedule your application to be run at some point in the future. When an alarm goes off, the Intent that had been registered for it is broadcast by the system, automatically starting the target application if it is not already running. Registered alarms are retained while the device is asleep (and can optionally wake the device up if they go off during that time), but will be cleared if it is turned off and rebooted.

Android alarm app when phone is off

The Alarm Manager holds a CPU wake lock as long as the alarm receiver's onReceive() method is executing. This guarantees that the phone will not sleep until you have finished handling the broadcast. Once onReceive() returns, the Alarm Manager releases this wake lock. This means that the phone will in some cases sleep as soon as your onReceive() method completes. If your alarm receiver called Context.startService(). it is possible that the phone will sleep before the requested service is launched. To prevent this, your BroadcastReceiver and Service will need to implement a separate wake lock policy to ensure that the phone continues running until the service becomes available.

Note: The Alarm Manager is intended for cases where you want to have your application code run at a specific time, even if your application is not currently running. For normal timing operations (ticks, timeouts, etc) it is easier and much more efficient to use Handler .

Note: Beginning with API 19 ( KITKAT ) alarm delivery is inexact: the OS will shift alarms in order to minimize wakeups and battery use. There are new APIs to support applications which need strict delivery guarantees; see setWindow(int, long, long, PendingIntent) and setExact(int, long, PendingIntent). Applications whose targetSdkVersion is earlier than API 19 will continue to see the previous behavior in which all alarms are delivered exactly when requested.

You do not instantiate this class directly; instead, retrieve it through )">Context.getSystemService(Context.ALARM_SERVICE).

Related posts

  • 4 Ways to Make Your Rooted Android Phone Run Faster Yesterday we saw 5 useful ways in which a user can speed up his non-rooted Android phone. As we already mentioned that a rooted Android...

  • Android Icons Meaning The Samsung Galaxy S5 cell phone has a good deal of features, options, and settings. Certainly you’ve seen a weird icon show up in your bar up top and wondered what...

  • 5 Best Video Editors for Android Most new smartphones these days come with the ability to record video in 1080p, which means many of us are walking around with pretty decent camcorders in our...

  • The Best Alarm Clock App for Android Where It Excels Advertisement Where It Falls Short Gentle Alarm is great, but it’s by no means perfect. First, its interface looks like something straight...

  • Android. Alarm Clock That Will Alarm When Phone Is Switched Off Jul 21, 2010 As far as I'm aware the standard alarm clock will not alarm when the phone is switched off. Does anybody know an...