1. Threading and Asynchronous Processing

Offloading intensive operations provides a smoother, more stable experience to the user. An application that is not responsive within 100 to 200 milliseconds creates the feeling of a slow application. Processing off the main UI thread may help speed up your applications. The Android SDK provides two easy ways to manage offload processing from the main UI thread: the AsyncTask class and the standard Java Thread class. An Activity or Fragment often needs to load data upon launch, which can be done asynchronously using a Loader class. In this chapter, you will learn how to make your applications more responsive by knowing when and how to move intensive operations off the main UI thread to be handled asynchronously. ...

Get Advanced Android™ Application Development, Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.