In this recipe, we'll be introduced to the fantastic world of Android services! As you probably know, Android was multitasking from the very first version. Multitasking is not a simple thing for an operating system running on limited hardware. Let's think about the memory that could be allocated for days, or weeks, to some specific processes with the user that runs new apps over and over again. At some point, the memory will run out and the OS will have to decide whether to prevent a new app from starting or to eliminate some old processes that the user hasn't used for a while. Obviously, the second option is the best. To allow new apps to run, the OS needs to free some memory still allocated to other apps. At this point, there is another question: Which apps can be removed from the memory?
Let...