Premise: A small web front end, completely not Android with iOS development, first contact, there are a lot of questions that do not understand. Please forgive me.
Environment: Win7
Results:
First, the SDK installation
Hint: The installation must pass the agent, otherwise will be very slow yo ~ ~
Install version 2.0 of Android Studio installation
Install the following SDK in studio
Add an environment variable (the variable value is the SDK path):
Second, global react-native installation
NPM install-g REACT-NATIVE-CLI
Third, test installation
Select a folder to run under the folder
react-native init awesomeprojectcd awesomeprojectreact-native run-android
The first line creates a react-native project,
The third line of Android project Gradle dependencies will be to compile node_modules under RN code, and join their own project.
This time, if you do not eject the packed window, you can manually trigger
CD awesomeprojectreact-native start
Packing react-native
At this time, you can see the project directory
Where Index.android.js is our entry file.
We can find the apk we need in this directory.
Install the APK on your Android phone.
Opening the app for the first time we need to set the address of the hot update by shaking the phone and shaking out the development menu. Click Dev Settings
Debugging
Phone and computer need to be on the same network, and fill in the address of the computer, the port number by default is 8081
After clicking on the confirmation, we can go back to the page and click on the reload on the development menu to see
First package we need to wait a minute.
The next thing we need to do is to modify the Index.android.js file on this basis.
React-native Development (i) Android environment deployment, Hello react-native