Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 466695
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:30:23+00:00 2026-05-12T23:30:23+00:00

I’m noticing a strange thing with Alarms on Android – they don’t always wake

  • 0

I’m noticing a strange thing with Alarms on Android – they don’t always wake up the device at the correct intervals. For example, if I set an alarm to start a service every 5 minutes (using RTC_WAKEUP, or similar), everything works fine until the device goes to sleep – after that, the alarm may not fire for minutes, or close to an hour. It usually does fire eventually – and it always fires if I wake the device by pressing Menu. Using repeating alarms (vs. re-setting them each time) has the same effect.

So my question is, are alarms guaranteed to fire at proper intervals when the device is asleep? I understand that I shouldn’t expect millisecond or second precision, but tens of minutes?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T23:30:23+00:00Added an answer on May 12, 2026 at 11:30 pm

    I’ve never programmed on Android but I was kinda bored so I googled around and found this, which seems to be very related: http://groups.google.com/group/android-developers/browse_thread/thread/f0303a539de3a74a (you’ll need to sign in to your google account in order to read it)

    I had another look at the AlarmManager
    documentation and I noticed that it
    only talks about using alarms to
    broadcast events, not start services.
    I changed things around to use a
    BroadcastReceiver instead that
    acquires the lock in its onReceive()
    and stored the lock reference as a
    static member of another class,
    following the example of the
    AlarmClock application:
    https://android.googlesource.com/platform/packages/apps/AlarmClock

    That seems to have worked. I guess
    what was happening was that my service
    starting alarms were being fired, but
    the device was sometimes going back to
    sleep before I could acquire the wake
    lock. Apparently the only guarantee
    that is made when an alarm is received
    is that the onReceive will run to
    completion.

    I just thought I’d post this in case
    anyone is ever searching for the same
    problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
I am using Paperclip to handle profile photo uploads in my app. They upload
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.