SlideShare a Scribd company logo
REACT NATIVE
MOJOTECH REACT SYMPOSIUM 2016
WHAT IS
REACT NATIVE?
WHAT IS REACT NATIVE
MAIN FEATURES
▸ Native Components
▸ Asynchronous Execution
▸ Touch Handling
▸ Flexbox & Styling
▸ Polyfills
▸ Extensible
React Native
GETTING STARTED
GETTING STARTED
COMMON PREREQUISITES
▸ Node.js 4.0+
▸ React Native Command Line Tools
▸ $ npm install -g react-native-cli
GETTING STARTED
PREREQUISITES FOR IOS APPLICATIONS
▸ Xcode
▸ which means you will need a Mac
GETTING STARTED
PREREQUISITES FOR ANDROID APPLICATIONS
▸ Android Studio 2.0+
▸ JDK 1.8+
▸ Setting the ANDROID_HOME environment variable
TOOLING AND
DEVELOPMENT
TOOLING AND DEVELOPMENT
RUNNING YOUR APPLICATION
▸ IOS
▸ $ react-native run-ios
▸ edit index.ios.js
▸ Android
▸ $ react-native run-android
▸ edit index.android.js
TOOLING AND DEVELOPMENT
PLATFORM SPECIFIC CODE
▸ You can choose your method for keeping platform specific
code organized
▸ /common/components

/android/components

/ios/components
▸ MyCustomButtonIOS.js

MyCustomButtonAndroid.js
TOOLING AND DEVELOPMENT
PLATFORM SPECIFIC CODE
▸ React Native provides a nicer way to do this also, with
platform specific extensions
▸ MyCustomButton.ios.js

MyCustomButton.android.js
▸ import MyCustomButton from ‘./components/MyCustomButton’;
TOOLING AND DEVELOPMENT
PLATFORM DETECTION
▸ React Native provides the Platform module for detecting
run time environment, when only small tweaks are needed
based on platform, and not a completely unique
component.
▸ Platform.OS === “ios” 

Platform.OS === “android”
1 var { Platform } = React;
2
3 var styles = StyleSheet.create({
4 height: (Platform.OS === 'ios') ? 200 : 180
5 });
TOOLING AND DEVELOPMENT
PLATFORM DETECTION
▸ React Native provides the Platform module for detecting
run time environment, when only small tweaks are needed
based on platform, and not a completely unique
component.
▸ Platform.Select 
 1 var Component = Platform.select({
2 ios: () => require('ComponentIOS'),
3 android: () => require('ComponentAndroid')
4 });
5
6 <Component />
1 var { Platform } = React;
2
3 var styles = StyleSheet.create({
4 container: {
5 flex: 1,
6 ...Platform.select({
7 ios: { backgroundColor: 'red' },
8 android: { backgroundColor: 'blue' }
9 })
10 }
11 });
STYLING YOUR
REACT NATIVE APP
STYLING YOUR REACT NATIVE APP
STYLES ARE IMPLEMENTED WITH JAVASCRIPT
▸ React Native layout
1 var styles = StyleSheet.create({
2 base: {
3 width: 38,
4 height: 38,
5 },
6 background: {
7 backgroundColor: '#222222',
8 },
9 active: {
10 borderWidth: 2,
11 borderColor: '#00ff00',
12 },
13 });
STYLING YOUR REACT NATIVE APP
STYLES ARE IMPLEMENTED WITH JAVASCRIPT
▸ All React Native core components accept a `style` attribute
▸ Both a single value or an array of values (mimics
`Object.assign` with the right-most values taking priority)
1 <Text style={styles.base} />
2 <View style={styles.background} />
3
4 <View style={[styles.base, styles.background]} />
5
6 <View style={[styles.base, this.state.active && styles.active]} />
STYLING YOUR REACT NATIVE APP
STYLES CAN BE PASSED AROUND AS PROPS
1 var List = React.createClass({
2 propTypes: {
3 style: View.propTypes.style,
4 elementStyle: View.propTypes.style,
5 },
6 render: function() {
7 return (
8 <View style={this.props.style}>
9 {elements.map((element) =>
10 <View style={[styles.element, this.props.elementStyle]} />
11 )}
12 </View>
13 );
14 }
15 });
16
17 // ... in another file ...
18 <List style={styles.list} elementStyle={styles.listElement} />
APP DEPLOYMENT
YEAH, SO HAVE FUN WITH
THAT…
Craig P Jolicoeur
APP DEPLOYMENT
RECOMMENDATIONS
RECOMMENDATIONS
SINGLE MAIN APP ENTRY POINT
▸ Use a single `app.jsx` file as your main entry point instead
of maintaining both `index.ios.js` and `index.android.js`
1 // index.{ios,android}.js
2 import { AppRegistry } from 'react-native';
3 import App from './app';
4
5 AppRegistry.registerComponent('MyApp', () => App);
6
7 // app.js
8 import React from 'react-native';
9 import { Provider } from 'react-redux';
10 import AppLoader from './components/app_loader';
11 import ReduxStore from './redux/store';
12
13 const MyApp = () => (
14 <Provider store={ReduxStore.store()}>
15 <AppLoader />
16 </Provider>
17 );
18
19 export default MyApp;
RECOMMENDATIONS
INTEGRATE FABRIC.IO
▸ Setup on Fabric (Crashlytics) as a custom logger in both iOS and
Android
▸ https://get.fabric.io/
▸ https://github.com/corymsmith/react-native-fabric
▸ https://medium.com/delivery-com-engineering/add-crashlytics-
to-your-react-native-ios-app-69a983a9062a#.35n80bfig
▸ (Android blog post to follow)
RECOMMENDATIONS
GENYMOTION
▸ Use the Genymotion Android Emulator for speed
improvements.
▸ The newer Android Studio 2.0+ emulator is much better
than it’s predecessor for native application dev (code
hot-swapping, etc…) but still behind Genymotion for
React Native development
▸ https://www.genymotion.com/
RECOMMENDATIONS
REACT-NATIVE-MAPS
▸ https://github.com/
lelandrichardson/react-
native-maps
▸ https://www.npmjs.com/
package/react-native-maps
RECOMMENDATIONS
REACT-NATIVE-LOCALIZATION
▸ https://github.com/stefalda/ReactNativeLocalization
▸ https://www.npmjs.com/package/react-native-localization
1 import LocalizedStrings from 'react-native-localization';
2
3 let strings = new LocalizedStrings({
4 en:{
5 how:"How do you want your egg today?",
6 boiledEgg:"Boiled egg"
7 },
8 it: {
9 how:"Come vuoi il tuo uovo oggi?",
10 boiledEgg:"Uovo sodo"
11 }
12 });
13
14 // In your component
15 <Text style={styles.title}>{strings.how}</Text>
1 import LocalizedStrings from 'react-native-localization';
2
3 let strings = new LocalizedStrings({
4 en:{
5 bread: "bread",
6 butter: "butter",
7 question: "Would you like {0} and {1}, or just {0}?"
8 },
9 ...
10 });
11
12 // In your component
13 <Text style={styles.title}>
14 {strings.formatString(strings.question, strings.bread, strings.butter)}
15 </Text>
RECOMMENDATIONS
REACT-NATIVE-RADIO-BUTTONS
▸ https://github.com/ArnaudRinquin/react-native-radio-
buttons
▸ https://www.npmjs.com/package/react-native-radio-
buttons
RECOMMENDATIONS
REACT-NATIVE-SWIPEOUT
▸ https://github.com/dancormier/react-native-swipeout
▸ https://www.npmjs.com/package/react-native-swipeout
RECOMMENDATIONS
JS.COACH
▸ https://js.coach/
PROS / CONS
PROS / CONS
THE GOOD
▸ Single unified codebase (less knowledge required, fewer
developers to maintain apps on two platforms)
▸ Single point of incoming errors/failures (only need to
debug one codebase)
▸ Faster development time for teams without experienced
Swift/Objective-C or Android SDK engineers
▸ Potential portability of components between mobile and
web versions of the same React application
PROS / CONS
THE BAD (MAYBE)
▸ Can be harder to add custom components
▸ Not as much control over styling/graphics/animations as on a
purely native platform
▸ Harder to profile performance and finely tune
▸ Not necessarily faster dev cycle then purely native applications.
▸ Project is still under heavy, active development and things
“break” often between releases
▸ Debugging while developing is “unpleasant”
EXTRA TOOLS
EXTRA TOOLS
PEPPERONI
▸ Pre-built boilerplate with features for login/authentication,
messaging, push notifications, cloud-based backend,
CodePush for direct app updates, etc…
▸ http://getpepperoni.com/
EXTRA TOOLS
CODEPUSH
▸ Open Source tool from Microsoft allowing you to push
code updates to your app instantly for Cordova and React
Native applications.
▸ http://microsoft.github.io/code-push/
EXTRA TOOLS
FASTLANE
▸ Automation done right (no really). Use this tool for native
development, not only React Native. Ease of deployment,
provisioning, certificate management, beta process, etc…
▸ https://fastlane.tools/
EXTRA TOOLS
RNPM
▸ React Native Package Manager built to ease your daily
React Native development. Inspired by CocoaPods,
Fastlane and react-native link
▸ https://github.com/rnpm/rnpm
EXTRA TOOLS
NUCLIDE
▸ React Native IDE built on top of Atom (by Facebook)
▸ Built in Chrome debugger, remote server access, Hack
language support, etc…
▸ https://nuclide.io/
EXTRA TOOLS
DECO IDE
▸ React Native IDE (OS X only)
▸ Live visual feedback on updates, drag-and-drop
component implementation, new file scaffold
boilerplate
▸ https://github.com/decosoftware/deco-ide
Ad

More Related Content

What's hot (20)

How native is React Native? | React Native vs Native App Development
How native is React Native? | React Native vs Native App DevelopmentHow native is React Native? | React Native vs Native App Development
How native is React Native? | React Native vs Native App Development
Devathon
 
Learn react-js
Learn react-jsLearn react-js
Learn react-js
C...L, NESPRESSO, WAFAASSURANCE, SOFRECOM ORANGE
 
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Edureka!
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
Rob Quick
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Preview
valuebound
 
Express JS
Express JSExpress JS
Express JS
Alok Guha
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
Knoldus Inc.
 
Introduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace ITIntroduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace IT
namespaceit
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native
Eric Deng
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
Akshay Mathur
 
Expressjs
ExpressjsExpressjs
Expressjs
Yauheni Nikanovich
 
NestJS
NestJSNestJS
NestJS
Wilson Su
 
Introduction to spring boot
Introduction to spring bootIntroduction to spring boot
Introduction to spring boot
Santosh Kumar Kar
 
React JS - Introduction
React JS - IntroductionReact JS - Introduction
React JS - Introduction
Sergey Romaneko
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
Tariqul islam
 
react redux.pdf
react redux.pdfreact redux.pdf
react redux.pdf
Knoldus Inc.
 
React Js Simplified
React Js SimplifiedReact Js Simplified
React Js Simplified
Sunil Yadav
 
Introduction to React native
Introduction to React nativeIntroduction to React native
Introduction to React native
Dhaval Barot
 
ReactJs
ReactJsReactJs
ReactJs
Sahana Banerjee
 
React Native
React NativeReact Native
React Native
Fatih Şimşek
 
How native is React Native? | React Native vs Native App Development
How native is React Native? | React Native vs Native App DevelopmentHow native is React Native? | React Native vs Native App Development
How native is React Native? | React Native vs Native App Development
Devathon
 
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Node.js Tutorial for Beginners | Node.js Web Application Tutorial | Node.js T...
Edureka!
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
Rob Quick
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Preview
valuebound
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
Knoldus Inc.
 
Introduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace ITIntroduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace IT
namespaceit
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native
Eric Deng
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
Akshay Mathur
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
Tariqul islam
 
React Js Simplified
React Js SimplifiedReact Js Simplified
React Js Simplified
Sunil Yadav
 
Introduction to React native
Introduction to React nativeIntroduction to React native
Introduction to React native
Dhaval Barot
 

Viewers also liked (20)

Intro to react native
Intro to react nativeIntro to react native
Intro to react native
ModusJesus
 
A tour of React Native
A tour of React NativeA tour of React Native
A tour of React Native
Tadeu Zagallo
 
Intro To React Native
Intro To React NativeIntro To React Native
Intro To React Native
FITC
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
Sambhu Lakshmanan
 
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
React Native Introduction: Making Real iOS and Android Mobile App By JavaScriptReact Native Introduction: Making Real iOS and Android Mobile App By JavaScript
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
Kobkrit Viriyayudhakorn
 
Is React reactive?
Is React reactive?Is React reactive?
Is React reactive?
Maurice De Beijer [MVP]
 
React & Redux
React & ReduxReact & Redux
React & Redux
Craig Jolicoeur
 
Success stories from agencies
Success stories from agenciesSuccess stories from agencies
Success stories from agencies
WistiaFest
 
React Ecosystem
React EcosystemReact Ecosystem
React Ecosystem
Craig Jolicoeur
 
深入淺出RoR
深入淺出RoR深入淺出RoR
深入淺出RoR
Eric Lee
 
React native. Bridge From Web To Mobile. Intro
React native. Bridge From Web To Mobile. IntroReact native. Bridge From Web To Mobile. Intro
React native. Bridge From Web To Mobile. Intro
Igor Izraylevych
 
React Native Intro
React Native IntroReact Native Intro
React Native Intro
Julia Vi
 
The productive developer guide to React
The productive developer guide to ReactThe productive developer guide to React
The productive developer guide to React
Maurice De Beijer [MVP]
 
React Native + Redux
React Native + ReduxReact Native + Redux
React Native + Redux
Ch Rick
 
Building UWP apps with React-Native
Building UWP apps with React-NativeBuilding UWP apps with React-Native
Building UWP apps with React-Native
Maurice De Beijer [MVP]
 
Hardware Acceleration in WebKit
Hardware Acceleration in WebKitHardware Acceleration in WebKit
Hardware Acceleration in WebKit
Joone Hur
 
Navigation in React Native
Navigation in React NativeNavigation in React Native
Navigation in React Native
Sambhu Lakshmanan
 
JavaScript, React Native and Performance at react-europe 2016
JavaScript, React Native and Performance at react-europe 2016JavaScript, React Native and Performance at react-europe 2016
JavaScript, React Native and Performance at react-europe 2016
Tadeu Zagallo
 
Styling React Native Applications
Styling React Native ApplicationsStyling React Native Applications
Styling React Native Applications
Jan Maršíček
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
Polidea
 
Intro to react native
Intro to react nativeIntro to react native
Intro to react native
ModusJesus
 
A tour of React Native
A tour of React NativeA tour of React Native
A tour of React Native
Tadeu Zagallo
 
Intro To React Native
Intro To React NativeIntro To React Native
Intro To React Native
FITC
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
Sambhu Lakshmanan
 
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
React Native Introduction: Making Real iOS and Android Mobile App By JavaScriptReact Native Introduction: Making Real iOS and Android Mobile App By JavaScript
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
Kobkrit Viriyayudhakorn
 
Success stories from agencies
Success stories from agenciesSuccess stories from agencies
Success stories from agencies
WistiaFest
 
深入淺出RoR
深入淺出RoR深入淺出RoR
深入淺出RoR
Eric Lee
 
React native. Bridge From Web To Mobile. Intro
React native. Bridge From Web To Mobile. IntroReact native. Bridge From Web To Mobile. Intro
React native. Bridge From Web To Mobile. Intro
Igor Izraylevych
 
React Native Intro
React Native IntroReact Native Intro
React Native Intro
Julia Vi
 
React Native + Redux
React Native + ReduxReact Native + Redux
React Native + Redux
Ch Rick
 
Hardware Acceleration in WebKit
Hardware Acceleration in WebKitHardware Acceleration in WebKit
Hardware Acceleration in WebKit
Joone Hur
 
JavaScript, React Native and Performance at react-europe 2016
JavaScript, React Native and Performance at react-europe 2016JavaScript, React Native and Performance at react-europe 2016
JavaScript, React Native and Performance at react-europe 2016
Tadeu Zagallo
 
Styling React Native Applications
Styling React Native ApplicationsStyling React Native Applications
Styling React Native Applications
Jan Maršíček
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
Polidea
 
Ad

Similar to React Native (20)

How To Integrate Native Android App With React Native.
How To Integrate Native Android App With React Native.How To Integrate Native Android App With React Native.
How To Integrate Native Android App With React Native.
Techugo
 
React Native
React NativeReact Native
React Native
Heber Silva
 
Lecture 1 Introduction to React Native.pptx
Lecture 1 Introduction to React Native.pptxLecture 1 Introduction to React Native.pptx
Lecture 1 Introduction to React Native.pptx
GevitaChinnaiah
 
Nativescript with angular 2
Nativescript with angular 2Nativescript with angular 2
Nativescript with angular 2
Christoffer Noring
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applications
Matteo Manchi
 
DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...
DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...
DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...
Olivier Destrebecq
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
Chiew Carol
 
Ultimate Survival - React-Native edition
Ultimate Survival - React-Native editionUltimate Survival - React-Native edition
Ultimate Survival - React-Native edition
Richard Radics
 
Introduction phonegap
Introduction phonegapIntroduction phonegap
Introduction phonegap
Rakesh Jha
 
Advanced programing in phonegap
Advanced programing in phonegapAdvanced programing in phonegap
Advanced programing in phonegap
Rakesh Jha
 
Hacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdfHacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdf
ShaiAlmog1
 
Getting started with the NDK
Getting started with the NDKGetting started with the NDK
Getting started with the NDK
Kirill Kounik
 
TK2323 Lecture 1 - Introduction to Mobile Application.pdf
TK2323 Lecture 1 - Introduction to Mobile Application.pdfTK2323 Lecture 1 - Introduction to Mobile Application.pdf
TK2323 Lecture 1 - Introduction to Mobile Application.pdf
Lam Chun
 
React native.key
React native.keyReact native.key
React native.key
Praveen Prasad
 
Visage Android Hands-on Lab (OSCON)
Visage Android Hands-on Lab (OSCON)Visage Android Hands-on Lab (OSCON)
Visage Android Hands-on Lab (OSCON)
Stephen Chin
 
Parkjihoon phonegap research_for_bada
Parkjihoon phonegap research_for_badaParkjihoon phonegap research_for_bada
Parkjihoon phonegap research_for_bada
웹데브모바일
 
Building Cross-Platform JavaScript Apps using Cordova
Building Cross-Platform JavaScript Apps using CordovaBuilding Cross-Platform JavaScript Apps using Cordova
Building Cross-Platform JavaScript Apps using Cordova
Noam Kfir
 
Lessons from a year of building apps with React Native
Lessons from a year of building apps with React NativeLessons from a year of building apps with React Native
Lessons from a year of building apps with React Native
Ryan Boland
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
Gunjan Kumar
 
React Native for ReactJS Devs
React Native for ReactJS DevsReact Native for ReactJS Devs
React Native for ReactJS Devs
Barak Cohen
 
How To Integrate Native Android App With React Native.
How To Integrate Native Android App With React Native.How To Integrate Native Android App With React Native.
How To Integrate Native Android App With React Native.
Techugo
 
Lecture 1 Introduction to React Native.pptx
Lecture 1 Introduction to React Native.pptxLecture 1 Introduction to React Native.pptx
Lecture 1 Introduction to React Native.pptx
GevitaChinnaiah
 
React Native for multi-platform mobile applications
React Native for multi-platform mobile applicationsReact Native for multi-platform mobile applications
React Native for multi-platform mobile applications
Matteo Manchi
 
DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...
DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...
DMCA #25: Jenkins - Docker & Android: Comment Docker peu faciliter la créatio...
Olivier Destrebecq
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
Chiew Carol
 
Ultimate Survival - React-Native edition
Ultimate Survival - React-Native editionUltimate Survival - React-Native edition
Ultimate Survival - React-Native edition
Richard Radics
 
Introduction phonegap
Introduction phonegapIntroduction phonegap
Introduction phonegap
Rakesh Jha
 
Advanced programing in phonegap
Advanced programing in phonegapAdvanced programing in phonegap
Advanced programing in phonegap
Rakesh Jha
 
Hacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdfHacking the Codename One Source Code - Part IV - Transcript.pdf
Hacking the Codename One Source Code - Part IV - Transcript.pdf
ShaiAlmog1
 
Getting started with the NDK
Getting started with the NDKGetting started with the NDK
Getting started with the NDK
Kirill Kounik
 
TK2323 Lecture 1 - Introduction to Mobile Application.pdf
TK2323 Lecture 1 - Introduction to Mobile Application.pdfTK2323 Lecture 1 - Introduction to Mobile Application.pdf
TK2323 Lecture 1 - Introduction to Mobile Application.pdf
Lam Chun
 
Visage Android Hands-on Lab (OSCON)
Visage Android Hands-on Lab (OSCON)Visage Android Hands-on Lab (OSCON)
Visage Android Hands-on Lab (OSCON)
Stephen Chin
 
Parkjihoon phonegap research_for_bada
Parkjihoon phonegap research_for_badaParkjihoon phonegap research_for_bada
Parkjihoon phonegap research_for_bada
웹데브모바일
 
Building Cross-Platform JavaScript Apps using Cordova
Building Cross-Platform JavaScript Apps using CordovaBuilding Cross-Platform JavaScript Apps using Cordova
Building Cross-Platform JavaScript Apps using Cordova
Noam Kfir
 
Lessons from a year of building apps with React Native
Lessons from a year of building apps with React NativeLessons from a year of building apps with React Native
Lessons from a year of building apps with React Native
Ryan Boland
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
Gunjan Kumar
 
React Native for ReactJS Devs
React Native for ReactJS DevsReact Native for ReactJS Devs
React Native for ReactJS Devs
Barak Cohen
 
Ad

Recently uploaded (20)

Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New VersionPixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
saimabibi60507
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 
Douwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License codeDouwan Crack 2025 new verson+ License code
Douwan Crack 2025 new verson+ License code
aneelaramzan63
 
Kubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptxKubernetes_101_Zero_to_Platform_Engineer.pptx
Kubernetes_101_Zero_to_Platform_Engineer.pptx
CloudScouts
 
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
TestMigrationsInPy: A Dataset of Test Migrations from Unittest to Pytest (MSR...
Andre Hora
 
Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]Get & Download Wondershare Filmora Crack Latest [2025]
Get & Download Wondershare Filmora Crack Latest [2025]
saniaaftab72555
 
Download Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With LatestDownload Wondershare Filmora Crack [2025] With Latest
Download Wondershare Filmora Crack [2025] With Latest
tahirabibi60507
 
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software DevelopmentSecure Test Infrastructure: The Backbone of Trustworthy Software Development
Secure Test Infrastructure: The Backbone of Trustworthy Software Development
Shubham Joshi
 
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...Exploring Code Comprehension  in Scientific Programming:  Preliminary Insight...
Exploring Code Comprehension in Scientific Programming: Preliminary Insight...
University of Hawai‘i at Mānoa
 
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New VersionPixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
Pixologic ZBrush Crack Plus Activation Key [Latest 2025] New Version
saimabibi60507
 
How can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptxHow can one start with crypto wallet development.pptx
How can one start with crypto wallet development.pptx
laravinson24
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Mastering Fluent Bit: Ultimate Guide to Integrating Telemetry Pipelines with ...
Eric D. Schabell
 
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and CollaborateMeet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Meet the Agents: How AI Is Learning to Think, Plan, and Collaborate
Maxim Salnikov
 
Landscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature ReviewLandscape of Requirements Engineering for/by AI through Literature Review
Landscape of Requirements Engineering for/by AI through Literature Review
Hironori Washizaki
 
Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025Avast Premium Security Crack FREE Latest Version 2025
Avast Premium Security Crack FREE Latest Version 2025
mu394968
 
FL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full VersionFL Studio Producer Edition Crack 2025 Full Version
FL Studio Producer Edition Crack 2025 Full Version
tahirabibi60507
 
Exploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the FutureExploring Wayland: A Modern Display Server for the Future
Exploring Wayland: A Modern Display Server for the Future
ICS
 
Top 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docxTop 10 Client Portal Software Solutions for 2025.docx
Top 10 Client Portal Software Solutions for 2025.docx
Portli
 
EASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License CodeEASEUS Partition Master Crack + License Code
EASEUS Partition Master Crack + License Code
aneelaramzan63
 
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...Explaining GitHub Actions Failures with Large Language Models Challenges, In...
Explaining GitHub Actions Failures with Large Language Models Challenges, In...
ssuserb14185
 
Download YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full ActivatedDownload YouTube By Click 2025 Free Full Activated
Download YouTube By Click 2025 Free Full Activated
saniamalik72555
 

React Native

  • 3. WHAT IS REACT NATIVE MAIN FEATURES ▸ Native Components ▸ Asynchronous Execution ▸ Touch Handling ▸ Flexbox & Styling ▸ Polyfills ▸ Extensible
  • 6. GETTING STARTED COMMON PREREQUISITES ▸ Node.js 4.0+ ▸ React Native Command Line Tools ▸ $ npm install -g react-native-cli
  • 7. GETTING STARTED PREREQUISITES FOR IOS APPLICATIONS ▸ Xcode ▸ which means you will need a Mac
  • 8. GETTING STARTED PREREQUISITES FOR ANDROID APPLICATIONS ▸ Android Studio 2.0+ ▸ JDK 1.8+ ▸ Setting the ANDROID_HOME environment variable
  • 10. TOOLING AND DEVELOPMENT RUNNING YOUR APPLICATION ▸ IOS ▸ $ react-native run-ios ▸ edit index.ios.js ▸ Android ▸ $ react-native run-android ▸ edit index.android.js
  • 11. TOOLING AND DEVELOPMENT PLATFORM SPECIFIC CODE ▸ You can choose your method for keeping platform specific code organized ▸ /common/components
 /android/components
 /ios/components ▸ MyCustomButtonIOS.js
 MyCustomButtonAndroid.js
  • 12. TOOLING AND DEVELOPMENT PLATFORM SPECIFIC CODE ▸ React Native provides a nicer way to do this also, with platform specific extensions ▸ MyCustomButton.ios.js
 MyCustomButton.android.js ▸ import MyCustomButton from ‘./components/MyCustomButton’;
  • 13. TOOLING AND DEVELOPMENT PLATFORM DETECTION ▸ React Native provides the Platform module for detecting run time environment, when only small tweaks are needed based on platform, and not a completely unique component. ▸ Platform.OS === “ios” 
 Platform.OS === “android” 1 var { Platform } = React; 2 3 var styles = StyleSheet.create({ 4 height: (Platform.OS === 'ios') ? 200 : 180 5 });
  • 14. TOOLING AND DEVELOPMENT PLATFORM DETECTION ▸ React Native provides the Platform module for detecting run time environment, when only small tweaks are needed based on platform, and not a completely unique component. ▸ Platform.Select 
 1 var Component = Platform.select({ 2 ios: () => require('ComponentIOS'), 3 android: () => require('ComponentAndroid') 4 }); 5 6 <Component /> 1 var { Platform } = React; 2 3 var styles = StyleSheet.create({ 4 container: { 5 flex: 1, 6 ...Platform.select({ 7 ios: { backgroundColor: 'red' }, 8 android: { backgroundColor: 'blue' } 9 }) 10 } 11 });
  • 16. STYLING YOUR REACT NATIVE APP STYLES ARE IMPLEMENTED WITH JAVASCRIPT ▸ React Native layout 1 var styles = StyleSheet.create({ 2 base: { 3 width: 38, 4 height: 38, 5 }, 6 background: { 7 backgroundColor: '#222222', 8 }, 9 active: { 10 borderWidth: 2, 11 borderColor: '#00ff00', 12 }, 13 });
  • 17. STYLING YOUR REACT NATIVE APP STYLES ARE IMPLEMENTED WITH JAVASCRIPT ▸ All React Native core components accept a `style` attribute ▸ Both a single value or an array of values (mimics `Object.assign` with the right-most values taking priority) 1 <Text style={styles.base} /> 2 <View style={styles.background} /> 3 4 <View style={[styles.base, styles.background]} /> 5 6 <View style={[styles.base, this.state.active && styles.active]} />
  • 18. STYLING YOUR REACT NATIVE APP STYLES CAN BE PASSED AROUND AS PROPS 1 var List = React.createClass({ 2 propTypes: { 3 style: View.propTypes.style, 4 elementStyle: View.propTypes.style, 5 }, 6 render: function() { 7 return ( 8 <View style={this.props.style}> 9 {elements.map((element) => 10 <View style={[styles.element, this.props.elementStyle]} /> 11 )} 12 </View> 13 ); 14 } 15 }); 16 17 // ... in another file ... 18 <List style={styles.list} elementStyle={styles.listElement} />
  • 20. YEAH, SO HAVE FUN WITH THAT… Craig P Jolicoeur APP DEPLOYMENT
  • 22. RECOMMENDATIONS SINGLE MAIN APP ENTRY POINT ▸ Use a single `app.jsx` file as your main entry point instead of maintaining both `index.ios.js` and `index.android.js` 1 // index.{ios,android}.js 2 import { AppRegistry } from 'react-native'; 3 import App from './app'; 4 5 AppRegistry.registerComponent('MyApp', () => App); 6 7 // app.js 8 import React from 'react-native'; 9 import { Provider } from 'react-redux'; 10 import AppLoader from './components/app_loader'; 11 import ReduxStore from './redux/store'; 12 13 const MyApp = () => ( 14 <Provider store={ReduxStore.store()}> 15 <AppLoader /> 16 </Provider> 17 ); 18 19 export default MyApp;
  • 23. RECOMMENDATIONS INTEGRATE FABRIC.IO ▸ Setup on Fabric (Crashlytics) as a custom logger in both iOS and Android ▸ https://get.fabric.io/ ▸ https://github.com/corymsmith/react-native-fabric ▸ https://medium.com/delivery-com-engineering/add-crashlytics- to-your-react-native-ios-app-69a983a9062a#.35n80bfig ▸ (Android blog post to follow)
  • 24. RECOMMENDATIONS GENYMOTION ▸ Use the Genymotion Android Emulator for speed improvements. ▸ The newer Android Studio 2.0+ emulator is much better than it’s predecessor for native application dev (code hot-swapping, etc…) but still behind Genymotion for React Native development ▸ https://www.genymotion.com/
  • 26. RECOMMENDATIONS REACT-NATIVE-LOCALIZATION ▸ https://github.com/stefalda/ReactNativeLocalization ▸ https://www.npmjs.com/package/react-native-localization 1 import LocalizedStrings from 'react-native-localization'; 2 3 let strings = new LocalizedStrings({ 4 en:{ 5 how:"How do you want your egg today?", 6 boiledEgg:"Boiled egg" 7 }, 8 it: { 9 how:"Come vuoi il tuo uovo oggi?", 10 boiledEgg:"Uovo sodo" 11 } 12 }); 13 14 // In your component 15 <Text style={styles.title}>{strings.how}</Text> 1 import LocalizedStrings from 'react-native-localization'; 2 3 let strings = new LocalizedStrings({ 4 en:{ 5 bread: "bread", 6 butter: "butter", 7 question: "Would you like {0} and {1}, or just {0}?" 8 }, 9 ... 10 }); 11 12 // In your component 13 <Text style={styles.title}> 14 {strings.formatString(strings.question, strings.bread, strings.butter)} 15 </Text>
  • 31. PROS / CONS THE GOOD ▸ Single unified codebase (less knowledge required, fewer developers to maintain apps on two platforms) ▸ Single point of incoming errors/failures (only need to debug one codebase) ▸ Faster development time for teams without experienced Swift/Objective-C or Android SDK engineers ▸ Potential portability of components between mobile and web versions of the same React application
  • 32. PROS / CONS THE BAD (MAYBE) ▸ Can be harder to add custom components ▸ Not as much control over styling/graphics/animations as on a purely native platform ▸ Harder to profile performance and finely tune ▸ Not necessarily faster dev cycle then purely native applications. ▸ Project is still under heavy, active development and things “break” often between releases ▸ Debugging while developing is “unpleasant”
  • 34. EXTRA TOOLS PEPPERONI ▸ Pre-built boilerplate with features for login/authentication, messaging, push notifications, cloud-based backend, CodePush for direct app updates, etc… ▸ http://getpepperoni.com/
  • 35. EXTRA TOOLS CODEPUSH ▸ Open Source tool from Microsoft allowing you to push code updates to your app instantly for Cordova and React Native applications. ▸ http://microsoft.github.io/code-push/
  • 36. EXTRA TOOLS FASTLANE ▸ Automation done right (no really). Use this tool for native development, not only React Native. Ease of deployment, provisioning, certificate management, beta process, etc… ▸ https://fastlane.tools/
  • 37. EXTRA TOOLS RNPM ▸ React Native Package Manager built to ease your daily React Native development. Inspired by CocoaPods, Fastlane and react-native link ▸ https://github.com/rnpm/rnpm
  • 38. EXTRA TOOLS NUCLIDE ▸ React Native IDE built on top of Atom (by Facebook) ▸ Built in Chrome debugger, remote server access, Hack language support, etc… ▸ https://nuclide.io/
  • 39. EXTRA TOOLS DECO IDE ▸ React Native IDE (OS X only) ▸ Live visual feedback on updates, drag-and-drop component implementation, new file scaffold boilerplate ▸ https://github.com/decosoftware/deco-ide