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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:38:09+00:00 2026-05-24T09:38:09+00:00

Is there any difference between AsyncSync being fired up from Activity or IntentService? I’m

  • 0

Is there any difference between AsyncSync being fired up from Activity or IntentService?

I’m building an app which downloads and uploads files via http. I use custom notification layout with progress bar for each transfer.
I choose between doing transfers in parallel or putting them into queue (which option would you recommend?).

For the option with queue I use an IntentService, so Android framework takes care of putting tasks into a queue for me.
For having them in parallel I use AsyncTasks. But I fire them up from IntentService (could be Service as well) – is there any point doing so? IntentService is terminated right after it executes AsyncTask, so the AsyncTask runs without any “parent”.

What if I fired up those AsyncTask from Activity, go to the homescreen and system decided to close this Activity? Can it do that? Will the AsyncTask survive it?

What would be the preferred approach for this case?

  • 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-24T09:38:10+00:00Added an answer on May 24, 2026 at 9:38 am

    AsyncTask isn’t really appropriate for things where you’re concerned about surviving outside the lifecycle of a component (if you need to message back to that component). If you’re going to the extent of having a service, I wouldn’t even bother with AsyncTasks. As far as parallel or queue, that really depends on a lot of different variables, but I certainly wouldn’t make it completely parallel for any number of downloads/uploads. I’d set some limit on the max number of concurrent transfers.

    There’s no point in using IntentService for parallel exeuction–you’ve noted the problem with that already. You’re getting into territory which is not really covered by the Android API. AsyncTask and IntentService are nice abstractions that make several scenarios easy, but parallel execution of many many tasks is not one of them. It’s probably best to use some of the Java threading/concurrency classes. Take a look at ThreadPoolExecutor.

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

Sidebar

Related Questions

Is there any difference between these tow pieces of code & which approach is
Is there any difference between these two LINQ statements: var query = from a
Is there any difference between using the field ID or _ID from a MongoDB
Is there any difference between using <img src=pathto.png /> and <img src=data:image/png;base64,encodedpngdata... /> from
Is there any difference between OnTouchListener and OnClickListener ? I am not asking from
Is there any difference between int on_exit(void (*function)(int , void *), void *arg); and
Is there any difference between: if foo is None: pass and if foo ==
Is there any difference between a volatile Object reference and AtomicReference in case I
Is there any difference between website and web application project? What if you are
is there any difference between: lock((IDictionary) _collection).SyncRoot) or lock(_collection)

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.