(Please bear in mind that I mean what I put on the title. I am also learning this right now and whatever I learn, I post it on this blog.)
First job is to set up your device. I use a windows 10 computer. Lets assume that our computer has nothing. We have to set it up from scratch.
Firstly we need to have java installed on our computer. Go ahead, search java 8 on google. Use this link to download java. Check your windows bit version (This PC-> Properties. Check System Type under System section). Install it. (One noob advice, don't install java 10 đ)
Next thing you need is to set up you computers environment. Go to Control Panel->System and Security->System. Click on Advanced system settings. Click Environment Variables... You will see a window like this.
In the system variables section, find a variable named Path, select it, click on Edit
Click New, add these two location "C:\Program Files\Java\jdk1.8.0_171\bin" and "C:\Program Files\Java\jre1.8.0_171\bin". That's it, your device is now equiped with java 8.
Now the next thing. Your computer should have node.js. because we will use npm. Use this link to download node.js and install it.
Now open windows powershell. Type npm install -g react-native-cli. This will install react-native-cli package on your computer. Now type npm install -g yarn. Yarn is a javascript package manager.
Another thing you need to have in your computer is Android SDK. You can download Android SDK from here and install it. After you install SDK, it is very important to add two variables in Environment variables. One is ANDROID_HOME and another one is ANDROID_SDK_HOME. you can see this image for reference.
Another thing you need to have in your computer is Android SDK. You can download Android SDK from here and install it. After you install SDK, it is very important to add two variables in Environment variables. One is ANDROID_HOME and another one is ANDROID_SDK_HOME. you can see this image for reference.
(Please make sure that your Android SDK installation path in in C:\Users\[Name of User]\AppData\Local\Android.)
Now your computer is ready for developing react-native cross platform mobile app. Lets build our first app. Go to any location of your computer. Type react-native init myApp. This will initialize and create a folder named myApp. There is a default app. You can run this on your mobile now. Connect a mobile using USB cable. Make sure your developer mode is on. Open powershell on myApp folder and type react-native run-android. Now look at your mobile. You will see something on screen.
Now your computer is ready for developing react-native cross platform mobile app. Lets build our first app. Go to any location of your computer. Type react-native init myApp. This will initialize and create a folder named myApp. There is a default app. You can run this on your mobile now. Connect a mobile using USB cable. Make sure your developer mode is on. Open powershell on myApp folder and type react-native run-android. Now look at your mobile. You will see something on screen.
CONGRATULATIONS!!! It's your first react native mobile app. It does nothing (đđ), but it still is something. Right?
*If you see an error like, You have not accepted licence agreement of the following SDK components, Please go to your SDK folder, open tools, then bin and open a command propmt or power shell there. enter this command sdkmanager --licenses. press Y for every option. And then you are set
Stay Tuned for next.
Comments
Post a Comment