O'Reilly logo

Asynchronous Android by Steve Liles

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required