Chapter 5. Multithreading
When the mobile phone market started falling and the smartphones one boomed, it was clear that users needed a large computing capacity on a mobile device. The growing demand for calculation and the availability of suitable hardware has led to multicore CPUs on the devices, allowing parallel execution of multiple tasks. Android engineers knew this before it happened. Moreover, that is why we have many options to execute different tasks at the same time, with great flexibility and a lot of different components to choose to apply to our multithreading strategy. However, are we doing well? To answer this question, we will see all the threading facets, from the basics of threading Java framework inherited by the Android platform to all of the classes Android provides for this aim. We will also see how Android handles its processes and how we can correctly choose the right component to use in different situations, because not all of them are interchangeable...