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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:39:25+00:00 2026-05-27T14:39:25+00:00

I have an Android application which depends on the value returned by a webservice.

  • 0

I have an Android application which depends on the value returned by a webservice. This value changes only once a week. Clients should detect this changed value, but the exact time they detect this change is not really important, 12 to 24 hours later should be no problem.

My current implementation starts an IntentService in the onCreate() method of my custom Application class which retrieves the value from the webservice. I also persist the last retrieved value in the SharedPreferences, so the application does not have to wait until this value is retrieved.

Now my question is if it is necessary to schedule the retrieval of this value after it’s first retrieval in the onCreate() method, lets say after 12 hours. I know the onCreate() method is called only once in the lifecycle of an application, but I do not know how likely it is an application will be terminated by the Android system. Is it reasonable to assume that the application will be terminated enough times so that scheduling is not necessary? And in the case I should schedule the operation, what will be the best way to achieve this?

  • 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-27T14:39:25+00:00Added an answer on May 27, 2026 at 2:39 pm

    If you used onCreate(), I don’t think you’d have any guarantees that it would be called a second time. E.g. if the user plugs their phone in to charge, has go-to-sleep turned off and leaves your app running for days on end. Very unlikely, but not impossible.

    If I were you I’d set up some sort of scheduled task. Maybe this link will help:

    http://developer.android.com/resources/articles/timed-ui-updates.html

    The example uses an OnClickListener to cancel the task.

    OnClickListener mStopListener = new OnClickListener() {
       public void onClick(View v) {
           mHandler.removeCallbacks(mUpdateTimeTask);
       }
    };
    

    You would want to put this elsewhere, in onDestroy() perhaps.

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

Sidebar

Related Questions

I have an android application in which if user changes his/her system font through
I have a problem with my android application which should connect to java tcp
I have web services written using java which interacts with the android application only
I have to develop an Android application which should access a specific version of
I have an Android application which sends some data to a webservice. I need
I have an Android Application which uses JNI calls. Now i want this application
I have a Web Service and an Android application that uses this web service.
I have an Android application which grabs some data from an external XML source.
I have a android application which needs username and password to login. I need
I have an Android application from which I want to upload some data to

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.