Background processing on Android

Multi-core processors were first introduced for Android in 2011. Generally, Android device manufacturers have boasted impressive specifications in their CPUs. It is only natural that the software should use the hardware to its full potential.

This recipe will cover using AsyncTask to execute short-running processes in the background without blocking the main thread.

Getting ready

For this recipe, we created a React Native application titled Multithreading.

In this recipe, we will use the react-native-button library. To install it, run the following command in the terminal from your project root directory:

$ npm install react-native-button --save

How to do it...

  1. Open the Android project using Android Studio. In Android ...

Get React Native Cookbook now with O’Reilly online learning.

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