Top Banner
1 React Native開発 Pham Van Dong
12

Introduce React Native

Jan 06, 2017

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduce React Native

1

React Native開発

Pham Van Dong

Page 2: Introduce React Native

目次

I. 環境構築 II. コンポーネント III. API IV. ネイティブモジュール V. ビルド

2

Page 3: Introduce React Native

環境構築

•OS: OS X, Window, Linux

•iOS:

–Xcode 7.0 ↑

•Android

–Android SDK

–Android Studio(or ADT for Eclipse)

–Android emulator(or Genymotion)

•NodeJs(npm) 4.0 ↑

3

Page 4: Introduce React Native

環境構築

•インストール

$ npm install -g react-native-cli

$ react-native init AwesomeProject

$ cd AwesomeProject

iOS:

Xcodeでios/AwesomeProject.xcodeproj開く

TextEditorでindex.ios.js開く

Android:

Android Studioでandroid/app開く

TextEditorでindex.android.js開く

$ react-native start #start server react-native

4

Page 5: Introduce React Native

環境構築

•Index.ios.js

5

Page 6: Introduce React Native

コンポーネント

6

Image

MapView

Text

TextInput WebView

View

NavigatorIOS

PickerIOS

TouchableHig

hlight

DatePickerIO

S

ActivityIndicat

orIOS

ProgressView

IOS

TouchableNat

iveFeedback

TouchableOp

acity

DrawerLayout

Android

ProgressBarA

ndroid

TabBarIOS.It

em

TabBarIOS

SwitchIOS

SliderIOS

SegmentedC

ontrolIOS

TouchableWith

outFeedback ScrollView

Navigator

Modal

ListView

ToolbarAndroi

d

SwitchAndroi

d

PullToRefres

hViewAndroid

ViewPagerAn

droid

Page 7: Introduce React Native

環境構築

7

Server

React-Native

Android App

Request index.android.bundle

Page 8: Introduce React Native

APIS

8

Alert

AlertIOS

Animated

AppRegistry

AppStateIOS

AsyncStorage

BackAndroid

CameraRoll

Dimensions

IntentAndroid

InteractionMana

ger

LayoutAnimation

LinkingIOS

NativeMethodsM

ixin

NetInfo

PanResponder

PixelRatio

PushNotificationI

OS

StatusBarIOS

StyleSheet

ToastAndroid

VibrationIOS

ActionSheetIOS

Page 11: Introduce React Native

ビルド(Android)

11

android {

...

defaultConfig { ... }

signingConfigs {

release {

storeFile file(MYAPP_RELEASE_STORE_FILE)

storePassword MYAPP_RELEASE_STORE_PASSWORD

keyAlias MYAPP_RELEASE_KEY_ALIAS

keyPassword MYAPP_RELEASE_KEY_PASSWORD

}

}

buildTypes {

release {

//minifyEnabled true

...

signingConfig signingConfigs.release

}

}

}

android/app/build.gradle

Page 12: Introduce React Native

ビルド(Android)

$ mkdir -p android/app/src/main/assets

$ react-native bundle --platform android --dev false --entry-

file index.android.js \

--bundle-output android/app/src/main/assets/index.android.bundle

\ --assets-dest android/app/src/main/res/

$ cd android && ./gradlew assembleRelease

12