O'Reilly logo

React Native Cookbook by Crysfel Villa, Stan Bershadskiy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required