Chapter 2. Staying Responsive with AsyncTask

The first Android-specific concurrency construct we'll look at is android.os.AsyncTask, a neat construct that encapsulates the messy business of managing threads, performing background work, and publishing progress and results back to the main thread to update the user interface.

In this chapter we will cover the following topics:

  • Introducing AsyncTask
  • Declaring AsyncTask types
  • Executing AsyncTasks
  • Providing feedback to the user
  • Providing progress updates
  • Canceling AsyncTasks
  • Handling exceptions
  • Controlling the level of concurrency
  • Common AsyncTask issues
  • Applications of AsyncTask

Introducing AsyncTask

AsyncTask was introduced in Android at API level 3, Cupcake, with the express purpose of helping developers to ...

Get Asynchronous Android now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.