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

  • Home
  • SEARCH
  • 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 8525953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:07:47+00:00 2026-06-11T08:07:47+00:00

I have two alarms that fire two separate services–one is executed every half-hour, and

  • 0

I have two alarms that fire two separate services–one is executed every half-hour, and the other every midnight. At exactly 00:00 of any day, both services will be executed and will need to share a common file. Is there a way for me to execute the two services one after the other (preferably the half-hour one first then the midnight-basis one) when both alarms are fired?

I’ve tried making the file accessor methods synchronized (that way the services will have to wait for the other to finish) but that doesn’t give me any control on which of the services gets executed first.

  • 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-06-11T08:07:49+00:00Added an answer on June 11, 2026 at 8:07 am

    2 simple options are:

    1. Have only 1 alarm, every 1/2 hour. Each time it fires, check if you are at Midnight. If you are at Midnight, then run both services.
    2. You can have your alarms run in a single IntentService, or @commonsware’s WakefulIntentService. These classes are designed to automatically queue, and not to run simultaneously. That way, when the one service is complete, the other will start automatically i.e. the synchronization is automatic.

    Personally, I would use the 1st option (and I have seen it recommended by @commonsware, so I think its probably the best route).

    It is simple to do, doesn’t rely on too many extra classes, and you have full control over which service gets run at which times. You also only need to have a single alarm, rather than 2, which I think will be easier to maintain, and slightly better on power consumption.

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

Sidebar

Related Questions

Have two triggers on a table. One trigger is executed when there is a
I have two applications written in Java that communicate with each other using XML
Have two actionsheet buttons and one modalviewcontroller on mainviewcontroller in application. Now for two
I have two classes (MVC view model) which inherits from one abstract base class.
I have two queries that find both the Zip codes, and the States for
I have a simple application that counts down to midnight and then plays a
Have two events: $('body').mouseup(function(e){} and $('.toggle').click(function(e){} I only want one of these to trigger.
i have a control that has two asp:HiddenField <asp:HiddenField runat=server ID=tabTitle /> <asp:HiddenField runat=server
So I have two scripts on a page: The first one randomly chooses a
I have two WCF Web API Contracts. Before this, I was happy that I

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.