DEV Community

Cover image for How to create react app on Android devices.
CodeWithArif
CodeWithArif

Posted on

How to create react app on Android devices.

React is a wonderful technology in web development category. It is basically a javascript library which is used in multiple react based framework like create-react-app or Next app. But the problem arouses when it comes to device preferences. Create-react-app requires symlink or symbolic links to be enabled on the device. That's why we needs a perfect device. It doesn't work on any virtual devices or kernels. Many beginners faced this problem, who doesn't have any laptop or PC. But now you can also run react app directly from your device.

To create a react app, we will need a custom Linux kernel, because we can't use node cli commands on Android without root. So, we will use an application known as Termux. You can find it from play-store. But it is deprecated now. So, download it from f-droid. 🔗 Link. After downloading, open it and give it required time to initialise. Then run the following commands.

apt update && apt upgrade
Enter fullscreen mode Exit fullscreen mode

This command will update all of the application dependencies. Then we have to install node js.

Pkg install nodejs-lts
Enter fullscreen mode Exit fullscreen mode

This will install the lifetime supported version of node js. A package manager called NPM and NPX automatically comes with node. Now we will create our first react app from Android.

Using localstorage system in termux allows you to access all the files of your device storage and sd-card. But this requires symlink or symbolic links. So, we will create our app inside termux virtual storage.

npx create-react-app <your_app_name>
Enter fullscreen mode Exit fullscreen mode

This process will take a few moment and then you will find your react app ready. All the necessary tools required in developing a react app are all here.

Now to edit the files, we will use an application called Acode-editor. Get it on play-store. And follow the rules.

Image description
Image description
Image description
Image description
Image description
Image description
Image description
Image description
Image description

All done.
Happy hacking...

Top comments (1)

Collapse
 
elbass509 profile image
Elbass509

I created my the React app sucessffuly but can't find the folder of the app I just created