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

  • Home
  • SEARCH
  • 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 6183441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:21:59+00:00 2026-05-24T01:21:59+00:00

Am a noob learning Android via a book and for threading I see there

  • 0

Am a noob learning Android via a book and for threading I see there are 3 main ways that are explained in the book:

  • Handlers via messaging
  • Handlers via post
  • Asynctask

All 3 seem good, my question is:
Is there a specific time when you use one of the above? Or is it personal preference?

EDIT:
If its not personal preference, please give me an example as to when you would use one if not the other (even a link would be appreciated)

Because I am planning on having multiple threads running (eg, one for total app running time, one for time before answer is selected etc in the app, one for moving the background image etc) and want to know which to choose. I can do the functionality of what I want using either of these 3 methods so am confused as to why there are 3 when it can be done with either one.

Thanks!

  • 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-24T01:22:00+00:00Added an answer on May 24, 2026 at 1:22 am

    Handler is a very basic way that allows you to execute some code on a different thread, typically UI thread. It does not tell you how to run your threads and you are free to do whatever you want in that respect. I would choose handleMessage approach if you have explicit messaging. That is you need to have some data sent and received. If you just need to do something, you can use Runnable. However, both methods are usable and a choice often would be result of a preference.

    AsyncTask is higher level concept that uses handlers under the hood. If you use it, you will not have to deal with threads yourself. Your asynchronous code will be executed via thread pool and controlled by the framework. You will have two methods that allow you to execute code on UI thread (onPostExecute and onProgressUpdate).

    In a nutshell, choose AsyncTask for most things that you do with multiple threads it will absolve you of a need to deal with thread management yourself. If you must have your own threads only then use handlers. Note however, that there are other cases when you have to use handlers. For example, with Messenger. Also I had cases when using onProgressUpdate is not sufficient. In this case I would use handler as well from doInBackground.

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

Sidebar

Related Questions

I am a noob learning Android via a book, i have a quick question.
Note that I'm a complete SQL noob and in the process of learning. Based
I'm learning Objective-C, noob question. I'm working on a project in Xcode that requires
I am a noob learning android and building a simple game at the same
I am a noob learning Android and making my own little demo project at
Total noob here learning openGL and I don't have any code to post because
I'm learning Scala, so this is probably pretty noob-irific. I want to have a
In advance: sorry for the noob question but I'm learning Cocoa & Objective-C and
I'm a real noob who just started learning 3d programming and i have a
I've just started learning WPF and like the power of databinding it presents; that

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.