Introduction
Multitasking is what computers do, and they do it amazingly well. In the case of mobile apps, the user expects the app to always be responsive even if a complex task is being executed.
Most devices are fast enough to execute tasks as needed, but sometimes those tasks take longer than a few milliseconds. If that task was to be executed on the main, or UI thread, then the UI would freeze.
Users demand that not only an app be responsive when executing long-running tasks, but also that animations and transitions run smoothly. In such a case, the task has to be moved into the background so that the app continues to give the impression that it is waiting for the user, when in fact, it is working hard.
Some tasks are not work happing but rather managing the tasks being run by others. This can include playing music or downloading a file. The app has already handed the task over to the operating system, and all that the user cares about is starting a new app or task.
The device must remain...