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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:29:58+00:00 2026-06-11T21:29:58+00:00

ok I have this application which needs to send periodic updates to a web-service,

  • 0

ok I have this application which needs to send periodic updates to a web-service, I have done a fair amount of research and I’ve come up with two service implementation patterns.

  1. Implement a service with a thread, the periodic update time may vary therefore, I will put the thread to sleep with the required time-interval, then call the web-service again. I also need to update an activity, therefore will be using a broadcast receiver or a messenger.

  2. Use a Service with a schedule timer/alarm manager, wake the system and use intent services coupled with a broadcast receiver.

Which would be the best approach?

  • 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-11T21:29:59+00:00Added an answer on June 11, 2026 at 9:29 pm

    I think I would go with the #2 option :

    1. Create an IntentService to do the update.
    2. Register a BroadcastReceiver with IntentFilter(s) and start the IntentService from it.
    3. Use AlarmManager to Broadcast the registered action at the required time intervals.

    I prefer this method because :

    1. It is a very flexible pattern : You can start the service anytime by registering the same receiver for different actions like network connection changes, system boot changes etc.,
    2. It keeps the logic loosely coupled from other parts of the app.
    3. There is no hassle of managing threads. You get it for free by using IntentService
    4. It is more android-ish way of solving this problem.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Django application which sometimes needs to send some data through TCP
This is a conceptual question. I have a client (mobile) application which needs to
I have this scala application which is very simple . All that it does
I have this part of script from my GAE application which uses webapp2, which
I have an application which resides in ROOT. This application has a java class(in
We have a application which is triggered from browser. This application consumes around 800
In my c# application i have this small form which is used to set
I have a button in my application which is bound to a command. This
I have a .NET application which serializes an object in binary format. this object
I have one desktop application which was implemented in C#. This app uploads file

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.