Build the react native installation environment

1: jdk installation

2: Installation of android sdk

3: Installation of node.js https://nodejs.org/

4: Install react-native via the command line tool npm install -g react-native- cli

This operation is very slow, you can copy it directly, https://github.com/CellChen/react-native-init

5: Under the project root directory of rn, execute react-native start to start the js server.

http://localhost:8081/index.android.bundle?platform=android Use this url to check whether the startup is successful.

5-1: Finally, various configurations can appear by shaking the phone.

 

6: Installation and download of curl https://curl.haxx.se/download.html, just download a curl.exe, and copy this curl.exe to the root directory of the react-native project,

curl -k "http://localhost:8081/index.android.bundle" > android/app/src/main/assets/index.android.bundle

Package the js related into the apk package. Of course, you can dynamically set the jsbundle file through code, so that the hot update function can be realized. For the specific implementation, please refer to the parent class of react-native inherited by activity. There is a setting method in the source code.

 

 

Reference documentation:

 

http://my.oschina.net/jackzlz/blog/508210?p={{page}}

 

http://www.cnblogs.com/meteoric_cry/p/4874517.html

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326784269&siteId=291194637