Installing React Native on Windows Tutorial.
Today, we will see how to install react native for android application development on windows.Lets get started with React Native Development on Windows XP, Vista, 7, 8.1, 10 for android application development beginners step by step guide.
What is React Native?
As we know, the number of smartphone users is increasing day by day. The number is increasing just because these devices fulfill the requirements easily like entertainment, shopping, security and much more. This increasing scenario inspires the developers to build more mobile applications related to mobile payment systems, social networking, etc. Mobile application development is recently a very big market and everyone is using their own Android or iOS mobile phones. But for companies who are developing Android and iOS apps together gets very high cost for their customers, because they have to develop individual applications for each platform and that makes their application cost high.
So Cross-Platform application development technology overcome this problem. React native provides Cross-platform app development technology provides the multi-platform app development by that develop the app that can run on multiple platforms with the same content and functionality. Moreover, developers should require to have vast knowledge of coding. Ultimately, this technology saves a lot more time as well as money, the main reason why it is more popular among the app developers.
Step-1. Installing dependencies :
First install the Chocolatey, a popular package manager for Windows. Follow the below steps to install chocolatey in windows machine:
1. Open Command prompt in administrative mode.
2. Run the below command in command prompt.
3. Install Node, Python and JDK with the help of Chocolatey. Run the below command in command prompt and make sure you are in admin mode.
Note : wait for above package installation and it will take sometime. During installation don't stop or close the command prompt.
Step-2 : React Native CLI
Once you are completed with above dependencies installation, then Follow the below instruction that helps to install the React Native command line interface.
Step-3 :Android development environment
Follow the below steps to configure and set-up the android development environment on window operating system.
1. Download and install latest version of Android Studio from google android developer official website :
Link to download android studio :
2. Install the Android SDK:
Android Studio installs the latest Android SDK by default. Building a React Native app with native code, however, requires the Android 6.0 (Marshmallow) SDK in particular. Additional Android SDKs can be installed through the SDK Manager in Android Studio.
Depending upon the android development version, you can manually download the SDK.
Lets install the SDK version in android studio :
To setup SDK Open Android Studio -> Tools -> Android -> SDK Manager
Currently, we have installed Android 4.4(KitKat), Android 6.0 (Marshmallow), Android 7.0 (Nougat) SDK version. In case you require Android 8.0 (Oreo) version then click on the checkbox and perform apply the change. It will take sometime and install the Android 8.0 (Oreo) version and then after you can work Android 8.0 (Oreo) development environment.
3. Configure the ANDROID_HOME environment variable
- Open system property in windows and Click on Advanced System Settings.
- Click on Environment Variables.
- Set the new Environment variable : Create a new ANDROID_HOME user variable that points to the path to your Android SDK.
Get the SDK location from android studio :
4. Start Android Virtual Device (AVD) :
Android virtual device is used to see the test result of our coding inside a virtual android machine just like a real android mobile phone.
- First step, set the platform-tools path of SDK in environment variable.
- To setup AVD Open Android Studio -> Tools -> Android -> AVD Manager.
- Click on Create New Virtual Device.
- Select your device.
- Select Android OS version System Image.
- Name the AVD and hit the Finish button.
- After done creating AVD just hit the Run button to start the AVD.
- Once you click on run it will launch the virtual device/ emulator :
Step-4 : Creating a new application
- Once you are done with all the installation then Create a folder in your drive in which you will store your all React Native projects. Than start command prompt and switch to project directory.
- Now type below command in command prompt and hit enter to create react native project.
Switch to project directory :
- Now it will start downloading the React Native supporting libraries from internet and wait for sometime until install.
- Then switch to project directory and run the below command to see the output in emulator. Run react-native run-android inside your React Native project folder:
- If your project build successfully then you can see a message on your command prompt screen BUILD SUCCESSFUL.
- If everything is set up correctly, you should see your new app running in your Android emulator shortly.
This is all about install react native on windows device. In case of any questions, please do comment in comment box below.