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 7444349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:29:28+00:00 2026-05-29T11:29:28+00:00

Alright so I’m working on a project where I want the app to check

  • 0

Alright so I’m working on a project where I want the app to check the internet for updates. I also want the user to be able to customize how often it makes these checks.

I’m kinda struggling with how I go about doing this.
I’m thinking I have a BroadcastReceiver check for the Intent.ACTION_BOOT_COMPLETED, and then start the AlarmService based upon a variable already set somewhere.

But what happens if the user wants to update the interval? How do I stop the old AlarmService and replace it with the new one?

Also how do I have my AlarmService run a “background update” portion in my app without actually running any of the activities?

EDIT: Also can someone advise if I’m using the AlarmService correctly? I’d want to check for updates fairly frequently, should I be using some other method? I’d check between 1-5 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-29T11:29:30+00:00Added an answer on May 29, 2026 at 11:29 am

    I do a similar thing in my app. I basically have two services: one that sets the alarm and the other that does the actual donwloading.
    When your BroadcastReceiver get’s the intent ACTION_BOOT_COMPLETED you start your alarmService which sends an broadcast to start the downloadService.
    So your BroadcastReceiver does both things: starts the alarmServcie if intent == BOOT_COMPLETED else it starts the downloadservice.
    Also if the user changes the periods in which he wants those updates to be done you store the chosen value in the preferences, start the alarmservice and retrieve the values to set up a new period, e. g. 1 hour, 2 hours

    Edit: Here is the info some info from the docs about pending Intents and how to cancel them. http://developer.android.com/reference/android/app/PendingIntent.html

    When the user changes the interval you should first cancel your old alarmservice and then set it again.

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

Sidebar

Related Questions

Alright, so my app is moving along, I am able to create accounts, and
Alright I don't see why this isnt working. It seems pretty simple. Here is
Alright, this is driving me nuts because my regex is working on Rubular, but
Alright I created some custom classes for my project sourced from this tutorial ,
Alright. My app has a text field and next to it are two buttons
Alright so i have been working on this Dynamic load of a spinner from
Alright. I have several queries <?php // Make a MySQL Connection mysql_connect(mm.hostname.net, user, pass)
Alright so my program is getting the user's input to figure out the prime
Alright, so let's say I'm writing a forum application, and I want pretty URLs.
Alright, I've got a quick question. I'm currently working with a legacy database, so

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.