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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:41:03+00:00 2026-05-25T12:41:03+00:00

My app needs a background service, where I can submit tasks to. The tasks

  • 0

My app needs a background service, where I can submit tasks to. The tasks can be quite generic, it might involve downloading feeds, fetching location one time, or fetching resources.This service needs minimal interaction from the activities and it should be started when the app launches and should quit if there is no pending task in the queue.

Is it a good idea? How would I design such a service? All suggestions are welcome

  • 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-25T12:41:04+00:00Added an answer on May 25, 2026 at 12:41 pm

    Hoping this architecture will help you:

    1. If you want to perform your task even after your activity is finished then use startService() else if you want to terminate all the tasks as soon as activity finishes then use bindService().

    2. When you call startservice() its oncreate() method is not called if the service is already running but its onStartCommand() gets called every time you call startservice(). You can use this property.

    3. You can implement a static method which can be accessed from your activity to put task in it and when you get the call in static method you can start a thread executing your tasks.

    Note: Don’t forget to release all the resources(threads etc.) in the service as android won’t do it for you.

    If your activity has finished then on task execution complete you can use stopSelf() for the service and release all the resources.

    you can try IntentService if it meets your need. Check this for more details.

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

Sidebar

Related Questions

I've got a location service running in background of my app with requestLocationUpdates(LocationManager.GPS_PROVIDER, 5*60*1000
I have a BlackBerry app running in the background that needs to know when
I have a BlackBerry app running in the background that needs to know when
My Cocoa app needs some small dynamically generated windows. How can I programmatically create
Background: As I'm developing an app that needs to be run on a device,
I'm actually working on an android app based on a background service sharing data
My app needs to build a buffer from all the selected cells on a
My app needs to play some audio files and I want to fade-out the
My current app needs to store address information for a user. I'm currently debating
My silverlight app needs to get back to the host from whence it came

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.