React-native Development (i) Android environment deployment, Hello react-native

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.