SlideShare a Scribd company logo
1 of 22
Download to read offline
Laboratorio Avanzato di Programmazione II
(LAP II)
Sviluppo di applicazioni mobili
native multipiattaforma
Prof. Antonio S. Calanducci
Corso di Laurea in Informatica, Unict
Anno accademico 2017/18
Lesson 02: React Native
Development Environment Setup
Step 1: Expo XDE
Expo is an open source toolchain that simplify mobile app development with React Native
• Made up of several components
Download Expo XDE (Expo Development Environment) from:
• https://github.com/expo/xde/releases
• Choose xde-Setup-2.22.1.exe for Win 10
• Choose xde-2.22.1-x86_64.AppImage for Linux
• Choose xde-2.22.1.dmg for Mac OS
Run the installer (Win)
Open the dmg and drag "Expo XDE" on the Application folder (MacOS)
Move the AppImage in your preferred location, "chmod +x xde-2.22.1-x86_64.AppImage", and start it
Open XDE. At the first run, you need to set up a free account
Step 2: Expo clients apps
Expo clients allow to test, debug and run apps built with Expo on
your physical iOS and Android devices and/or iOS simulator/Android
emulators
• It will reload automatically the app every time your source code
changes
From your iOS/Android devices download:
• https://itunes.apple.com/app/apple-store/id982107779?
ct=www&mt=8
• https://play.google.com/store/apps/details?
id=host.exp.exponent&referrer=www
Step 3: Run the "Hello World" app
Open Expo XDE
Create a new project
• choose the blank template
• use hello-world as project name
Click on the Share button
Open the Expo client on your device
• click on Scan QR code option and point to your dev machine
screen
Step 3: Install a Code Editor
Here my preferred ones:
• Atom (https://atom.io) - macOS/Win/Linux
• Visual Studio Code (https://code.visualstudio.com) -
macOS/Win/Linux
• Sublime Text 3 (https://www.sublimetext.com) - macOS/
Win/Linux
Step 3: Visual Studio Code
Download Visual Studio Code from:
• https://code.visualstudio.com
VS Code optionally requires a GIT client
If you are using Linux, install with your Package manager
(apt-get install git)
On Mac OS, git comes pre-installed with Xcode
For Windows, go to the next slide :)
Step 4: Chocolatey (Win)
Chocolatey is a Package Manager for Windows
• Easily manage all aspects of Windows software (installation,
configuration, upgrade, and uninstallation)
Installation instructions (https://chocolatey.org/install):
• Open Command Prompt as Administrator (Run As Admin)
• Copy and Paste the following text:
• @"%SystemRoot%System32WindowsPowerShellv1.0powershell.exe" -
NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-
Object System.Net.WebClient).DownloadString('https://chocolatey.org/
install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%chocolateybin"
Step 5: Install Git
Install GIT with with one of the following way:
• Download and run the installer from
• https://git-scm.com/downloads
• Use Chocolatey (recommended):
• From the Command prompt, type:
• choco install -y git -params '"/GitAndUnixToolsOnPath"'
Step 6: Node.js installation (Windows)
Several ways:
• via Chocolatey (recommended)
• download from https://chocolatey.org
• choco install nodejs.install
• with Windows installer at (easier):
• https://nodejs.org/en/download/
Step 6: Node.js installation (Linux/macOS)
Several ways:
• with Node Version Manager (nvm):
• (Linux): $ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/
install.sh | bash
• (MacOS): $ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/
install.sh | bash
• $ source ~/.profile (or source ~/.bash_profile for Mac OS)
• $ nvm install 8
• more info here: https://github.com/creationix/nvm#install-script
• via Package Manager:
• https://nodejs.org/en/download/package-manager/
• using a pre-built installer:
• https://nodejs.org/en/download/
Node.js installation (macOS)
Via Homebrew (the missing package manger for macOS):
• $ /usr/bin/ruby -e "$(curl -fsSL https://
raw.githubusercontent.com/Homebrew/install/
master/install)”
• $ brew install node
• Info on Homebrew here: https://brew.sh
Step 7 (optional): install Genymotion
Genymotion is a Android emulator
it’s free for educational purpose and personal usage:
Download the Personal Edition and install it from:
• https://www.genymotion.com/fun-zone/
You need to create a free account
VirtualBox is required (download and install VBox first)
• so it cannot be run in a virtualized host
Step 7 (optional): Genymotion configuration
Start Genymotion
Click "Add" to add a new virtual device
Choose one of
Start the Virtual device
From the left bar, click on GApps
• this will install the Google Services and the Play Store
• Install Expo from the Play Store
Step 8: Visual Studio Code extensions
https://medium.com/react-native-training/vscode-for-react-
native-526ec4a368ce
React Native Tools
Prettier
Auto Close Tag
Auto Complete Tag
Color Highlight
Path Intellisense
Babel JavaScript or Sublime Babel
Linter (ESLint)
Code linting is a type of static analysis that is frequently
used to find problematic patterns or code that doesn’t
adhere to certain style guidelines
• JavaScript, being a dynamic and loosely-typed language,
is especially prone to developer error
• Linting tools like ESLint allow developers to discover
problems with their JavaScript code without executing it
Step 9a (optional): ESLint installation
Atom:
• packages to install: “linter”, “linter-eslint”
Visual Studio Code
• (from a terminal:) $ npm install -g eslint
• extension to install: “ESLint”
Step 9b (optional): ESlint configuration
In your project directory:
• eslint --init
And choose the following answers:
• Use a popular style guide
• Airbnb
• Do you use React? Y
• JSON
{
"extends": "airbnb",
"rules": {
"react/jsx-filename-extension": [
2,
{
"extensions": [".js", ".jsx"]
}
]
}
}
Modify .eslintrc.json:
{
"editor.formatOnSave": true,
"prettier.eslintIntegration": true
}
edit VSCode User Preferences:
Step 10 (optional): Expo CLI
Sometimes it's quicker to start the React Native packager
without opening the XDE, using a terminal
VSCode has an integrated terminal too
From a terminal:
• $ npm install -g exp
Test your installation
Open the "Hello World" project folder from your editor
Start the React Native packager from XDE or with:
• $ exp start
Start Genymotion (and/or the iOS Simulator if you are on a Mac):
• Open the Expo client, switch to the "Explore" tab, click on the
Search icon
• Copy and paste the URL from XDE (es: exp://192.168.1.6:19000)
Do a simple edit in the code and see if the app refreshes
Expo tips
on iOS: Cmd+D shows the Expo debug menu
on iOS: Cmd+R reloads the app
on Genymotion: Ctrl+M shows the Expo debug menu (R,R,
reloads the app)
Enable Live Reload or Hot Reload (only one of the two):
• every time you save a file, Expo will reload the app
If you want to reload faster, switch to LAN

(if you are connected to the same LAN!)
Snack
if you don’t want to install anything on your machine and
learn React Native anyway, you can use Snack at:
• https://snack.expo.io
Use Expo apps on your iOS and Android devices
Questions

More Related Content

What's hot

Apache Cordova, Hybrid Application Development
Apache Cordova, Hybrid Application DevelopmentApache Cordova, Hybrid Application Development
Apache Cordova, Hybrid Application Developmentthedumbterminal
 
Develop android application with mono for android
Develop android application with mono for androidDevelop android application with mono for android
Develop android application with mono for androidNicko Satria Consulting
 
Intro to Ionic for Building Hybrid Mobile Applications
Intro to Ionic for Building Hybrid Mobile ApplicationsIntro to Ionic for Building Hybrid Mobile Applications
Intro to Ionic for Building Hybrid Mobile ApplicationsSasha dos Santos
 
Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day trainingTroy Miles
 
Apps with Apache Cordova and Phonegap
Apps with Apache Cordova and PhonegapApps with Apache Cordova and Phonegap
Apps with Apache Cordova and PhonegapChristian Grobmeier
 
Cordova: APIs and instruments
Cordova: APIs and instrumentsCordova: APIs and instruments
Cordova: APIs and instrumentsIvano Malavolta
 
Write Better JavaScript
Write Better JavaScriptWrite Better JavaScript
Write Better JavaScriptKevin Whinnery
 
Ionic Crash Course! Hack-a-ton SF
Ionic Crash Course! Hack-a-ton SFIonic Crash Course! Hack-a-ton SF
Ionic Crash Course! Hack-a-ton SFLukas Ruebbelke
 
Cordova / PhoneGap, mobile apps development with HTML5/JS/CSS
Cordova / PhoneGap, mobile apps development with HTML5/JS/CSSCordova / PhoneGap, mobile apps development with HTML5/JS/CSS
Cordova / PhoneGap, mobile apps development with HTML5/JS/CSSGabriel Huecas
 
Xamarin forms introduction by Taswar Bhatti and Ahmed Assad
Xamarin forms introduction by Taswar Bhatti and Ahmed AssadXamarin forms introduction by Taswar Bhatti and Ahmed Assad
Xamarin forms introduction by Taswar Bhatti and Ahmed AssadTaswar Bhatti
 
Hybrid Apps with Ionic Framework
Hybrid Apps with Ionic FrameworkHybrid Apps with Ionic Framework
Hybrid Apps with Ionic FrameworkBramus Van Damme
 
Modern Web Applications Utilizing HTML5 APIs
Modern Web Applications Utilizing HTML5 APIsModern Web Applications Utilizing HTML5 APIs
Modern Web Applications Utilizing HTML5 APIsIdo Green
 
Utilizing HTML5 APIs
Utilizing HTML5 APIsUtilizing HTML5 APIs
Utilizing HTML5 APIsIdo Green
 
OSCON Titanium Tutorial
OSCON Titanium TutorialOSCON Titanium Tutorial
OSCON Titanium TutorialKevin Whinnery
 
Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)ejlp12
 
Lessons Learned From Applications That Kicked Titanium's Ass
Lessons Learned From Applications That Kicked Titanium's AssLessons Learned From Applications That Kicked Titanium's Ass
Lessons Learned From Applications That Kicked Titanium's AssKevin Whinnery
 

What's hot (20)

React Native
React NativeReact Native
React Native
 
Apache Cordova, Hybrid Application Development
Apache Cordova, Hybrid Application DevelopmentApache Cordova, Hybrid Application Development
Apache Cordova, Hybrid Application Development
 
Develop android application with mono for android
Develop android application with mono for androidDevelop android application with mono for android
Develop android application with mono for android
 
Intro to Ionic for Building Hybrid Mobile Applications
Intro to Ionic for Building Hybrid Mobile ApplicationsIntro to Ionic for Building Hybrid Mobile Applications
Intro to Ionic for Building Hybrid Mobile Applications
 
Ionic framework one day training
Ionic framework one day trainingIonic framework one day training
Ionic framework one day training
 
Apps with Apache Cordova and Phonegap
Apps with Apache Cordova and PhonegapApps with Apache Cordova and Phonegap
Apps with Apache Cordova and Phonegap
 
Cordova: APIs and instruments
Cordova: APIs and instrumentsCordova: APIs and instruments
Cordova: APIs and instruments
 
Write Better JavaScript
Write Better JavaScriptWrite Better JavaScript
Write Better JavaScript
 
Ionic Crash Course! Hack-a-ton SF
Ionic Crash Course! Hack-a-ton SFIonic Crash Course! Hack-a-ton SF
Ionic Crash Course! Hack-a-ton SF
 
Apache Cordova
Apache CordovaApache Cordova
Apache Cordova
 
Titanium @ Minnebar
Titanium @ MinnebarTitanium @ Minnebar
Titanium @ Minnebar
 
Cordova / PhoneGap, mobile apps development with HTML5/JS/CSS
Cordova / PhoneGap, mobile apps development with HTML5/JS/CSSCordova / PhoneGap, mobile apps development with HTML5/JS/CSS
Cordova / PhoneGap, mobile apps development with HTML5/JS/CSS
 
Xamarin forms introduction by Taswar Bhatti and Ahmed Assad
Xamarin forms introduction by Taswar Bhatti and Ahmed AssadXamarin forms introduction by Taswar Bhatti and Ahmed Assad
Xamarin forms introduction by Taswar Bhatti and Ahmed Assad
 
Hybrid Apps with Ionic Framework
Hybrid Apps with Ionic FrameworkHybrid Apps with Ionic Framework
Hybrid Apps with Ionic Framework
 
Modern Web Applications Utilizing HTML5 APIs
Modern Web Applications Utilizing HTML5 APIsModern Web Applications Utilizing HTML5 APIs
Modern Web Applications Utilizing HTML5 APIs
 
Utilizing HTML5 APIs
Utilizing HTML5 APIsUtilizing HTML5 APIs
Utilizing HTML5 APIs
 
OSCON Titanium Tutorial
OSCON Titanium TutorialOSCON Titanium Tutorial
OSCON Titanium Tutorial
 
Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)
 
Apache cordova
Apache cordovaApache cordova
Apache cordova
 
Lessons Learned From Applications That Kicked Titanium's Ass
Lessons Learned From Applications That Kicked Titanium's AssLessons Learned From Applications That Kicked Titanium's Ass
Lessons Learned From Applications That Kicked Titanium's Ass
 

Similar to Lesson 02 - React Native Development Environment Setup

Android Application Development Environment Setup
Android Application Development Environment SetupAndroid Application Development Environment Setup
Android Application Development Environment SetupIan Pinto
 
Mobile application and Game development
Mobile application and Game developmentMobile application and Game development
Mobile application and Game developmentWomen In Digital
 
Android build on windows
Android build on windowsAndroid build on windows
Android build on windowsAddweup
 
Mobile Worshop Lab guide
Mobile Worshop Lab guideMobile Worshop Lab guide
Mobile Worshop Lab guideMan Chan
 
Compile open cpn on windows
Compile open cpn on windowsCompile open cpn on windows
Compile open cpn on windowsrandikaucsc
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandCI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandTroublemaker Khunpech
 
React native on windows
React native on windowsReact native on windows
React native on windowsAbdul Karim
 
Node js presentation
Node js presentationNode js presentation
Node js presentationshereefsakr
 
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!Umar Yusuf
 
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!Umar Yusuf
 
NCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile AppsNCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile AppsJohn M. Wargo
 
Mobile os by waqas
Mobile os by waqasMobile os by waqas
Mobile os by waqas8neutron8
 
Installation and your first code
Installation and your first codeInstallation and your first code
Installation and your first codeGideros Mobile
 
Selenium tools-installation
Selenium tools-installationSelenium tools-installation
Selenium tools-installationITeLearn
 
Selenium tools-installation
Selenium tools-installationSelenium tools-installation
Selenium tools-installationIT eLearn
 
eXoer on the grill: eXo Add-ons factory using Docker and Codenvy
eXoer on the grill: eXo Add-ons factory using Docker and CodenvyeXoer on the grill: eXo Add-ons factory using Docker and Codenvy
eXoer on the grill: eXo Add-ons factory using Docker and CodenvyeXo Platform
 
Ayw android env_setup
Ayw android env_setupAyw android env_setup
Ayw android env_setuppbeerak
 

Similar to Lesson 02 - React Native Development Environment Setup (20)

Android Application Development Environment Setup
Android Application Development Environment SetupAndroid Application Development Environment Setup
Android Application Development Environment Setup
 
Android app upload
Android app uploadAndroid app upload
Android app upload
 
Mobile application and Game development
Mobile application and Game developmentMobile application and Game development
Mobile application and Game development
 
Android build on windows
Android build on windowsAndroid build on windows
Android build on windows
 
Appium on mac platform
Appium on mac platformAppium on mac platform
Appium on mac platform
 
W1.pptx
W1.pptxW1.pptx
W1.pptx
 
Mobile Worshop Lab guide
Mobile Worshop Lab guideMobile Worshop Lab guide
Mobile Worshop Lab guide
 
Compile open cpn on windows
Compile open cpn on windowsCompile open cpn on windows
Compile open cpn on windows
 
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day ThailandCI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
CI/CD with Jenkins and Docker - DevOps Meetup Day Thailand
 
React native on windows
React native on windowsReact native on windows
React native on windows
 
Node js presentation
Node js presentationNode js presentation
Node js presentation
 
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
 
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
 
NCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile AppsNCDevCon 2017 - Cross Platform Mobile Apps
NCDevCon 2017 - Cross Platform Mobile Apps
 
Mobile os by waqas
Mobile os by waqasMobile os by waqas
Mobile os by waqas
 
Installation and your first code
Installation and your first codeInstallation and your first code
Installation and your first code
 
Selenium tools-installation
Selenium tools-installationSelenium tools-installation
Selenium tools-installation
 
Selenium tools-installation
Selenium tools-installationSelenium tools-installation
Selenium tools-installation
 
eXoer on the grill: eXo Add-ons factory using Docker and Codenvy
eXoer on the grill: eXo Add-ons factory using Docker and CodenvyeXoer on the grill: eXo Add-ons factory using Docker and Codenvy
eXoer on the grill: eXo Add-ons factory using Docker and Codenvy
 
Ayw android env_setup
Ayw android env_setupAyw android env_setup
Ayw android env_setup
 

More from University of Catania

Presentazione Corso LAP 2 A.A. 2016/2017
Presentazione Corso LAP 2 A.A. 2016/2017Presentazione Corso LAP 2 A.A. 2016/2017
Presentazione Corso LAP 2 A.A. 2016/2017University of Catania
 
LAP 2 Lezione 8: Properties, Database, Media, Filesystem
LAP 2  Lezione 8: Properties, Database, Media, FilesystemLAP 2  Lezione 8: Properties, Database, Media, Filesystem
LAP 2 Lezione 8: Properties, Database, Media, FilesystemUniversity of Catania
 
LAP2 iOS and Android Development environment setup
LAP2 iOS and Android Development environment setupLAP2 iOS and Android Development environment setup
LAP2 iOS and Android Development environment setupUniversity of Catania
 
Laboratorio Creare e pubblicare mobile apps per iOS e Android Configurazione ...
Laboratorio Creare e pubblicare mobile apps per iOS e Android Configurazione ...Laboratorio Creare e pubblicare mobile apps per iOS e Android Configurazione ...
Laboratorio Creare e pubblicare mobile apps per iOS e Android Configurazione ...University of Catania
 
Sistemi lezione-iv-internet-e-posta-elettronica
Sistemi lezione-iv-internet-e-posta-elettronicaSistemi lezione-iv-internet-e-posta-elettronica
Sistemi lezione-iv-internet-e-posta-elettronicaUniversity of Catania
 
Sistemi lezione-iii-reti-di-calcolatori
Sistemi lezione-iii-reti-di-calcolatoriSistemi lezione-iii-reti-di-calcolatori
Sistemi lezione-iii-reti-di-calcolatoriUniversity of Catania
 
Sistemi - Lezione XIV - Introduzione a HTML
Sistemi - Lezione XIV - Introduzione a HTMLSistemi - Lezione XIV - Introduzione a HTML
Sistemi - Lezione XIV - Introduzione a HTMLUniversity of Catania
 
Sistemi - Lezione XIII - Blogs e Blogger
Sistemi - Lezione XIII - Blogs e BloggerSistemi - Lezione XIII - Blogs e Blogger
Sistemi - Lezione XIII - Blogs e BloggerUniversity of Catania
 
Sistemi lezione i - Presentazione - hardware
Sistemi   lezione i - Presentazione - hardwareSistemi   lezione i - Presentazione - hardware
Sistemi lezione i - Presentazione - hardwareUniversity of Catania
 
Sistemi lezione viii - google altri servizi
Sistemi   lezione viii - google altri serviziSistemi   lezione viii - google altri servizi
Sistemi lezione viii - google altri serviziUniversity of Catania
 
Sistemi lezione xi - picasa web album - social bookmarking - notizie 2
Sistemi   lezione xi - picasa web album - social bookmarking - notizie 2Sistemi   lezione xi - picasa web album - social bookmarking - notizie 2
Sistemi lezione xi - picasa web album - social bookmarking - notizie 2University of Catania
 
Sistemi lezione x - introduzione al web 2.0 - flickr
Sistemi   lezione x - introduzione al web 2.0 - flickrSistemi   lezione x - introduzione al web 2.0 - flickr
Sistemi lezione x - introduzione al web 2.0 - flickrUniversity of Catania
 
Sistemi di elaborazione dell'informazione - Google Docs basics
Sistemi di elaborazione dell'informazione - Google Docs basicsSistemi di elaborazione dell'informazione - Google Docs basics
Sistemi di elaborazione dell'informazione - Google Docs basicsUniversity of Catania
 

More from University of Catania (17)

Presentazione Corso LAP 2 A.A. 2016/2017
Presentazione Corso LAP 2 A.A. 2016/2017Presentazione Corso LAP 2 A.A. 2016/2017
Presentazione Corso LAP 2 A.A. 2016/2017
 
LAP 2 Lezione 8: Properties, Database, Media, Filesystem
LAP 2  Lezione 8: Properties, Database, Media, FilesystemLAP 2  Lezione 8: Properties, Database, Media, Filesystem
LAP 2 Lezione 8: Properties, Database, Media, Filesystem
 
LAP2 iOS and Android Development environment setup
LAP2 iOS and Android Development environment setupLAP2 iOS and Android Development environment setup
LAP2 iOS and Android Development environment setup
 
Laboratorio Creare e pubblicare mobile apps per iOS e Android Configurazione ...
Laboratorio Creare e pubblicare mobile apps per iOS e Android Configurazione ...Laboratorio Creare e pubblicare mobile apps per iOS e Android Configurazione ...
Laboratorio Creare e pubblicare mobile apps per iOS e Android Configurazione ...
 
Sistemi lezione-v-google-web-search
Sistemi lezione-v-google-web-searchSistemi lezione-v-google-web-search
Sistemi lezione-v-google-web-search
 
Sistemi lezione-iv-internet-e-posta-elettronica
Sistemi lezione-iv-internet-e-posta-elettronicaSistemi lezione-iv-internet-e-posta-elettronica
Sistemi lezione-iv-internet-e-posta-elettronica
 
Sistemi lezione-iii-reti-di-calcolatori
Sistemi lezione-iii-reti-di-calcolatoriSistemi lezione-iii-reti-di-calcolatori
Sistemi lezione-iii-reti-di-calcolatori
 
Sistemi lezione-ii
Sistemi lezione-iiSistemi lezione-ii
Sistemi lezione-ii
 
Sistemi lezione xv - cenni su css
Sistemi   lezione xv - cenni su cssSistemi   lezione xv - cenni su css
Sistemi lezione xv - cenni su css
 
Sistemi - Lezione XIV - Introduzione a HTML
Sistemi - Lezione XIV - Introduzione a HTMLSistemi - Lezione XIV - Introduzione a HTML
Sistemi - Lezione XIV - Introduzione a HTML
 
Sistemi - Lezione XIII - Blogs e Blogger
Sistemi - Lezione XIII - Blogs e BloggerSistemi - Lezione XIII - Blogs e Blogger
Sistemi - Lezione XIII - Blogs e Blogger
 
Corso manzoni lezione 1-2-3
Corso manzoni   lezione 1-2-3Corso manzoni   lezione 1-2-3
Corso manzoni lezione 1-2-3
 
Sistemi lezione i - Presentazione - hardware
Sistemi   lezione i - Presentazione - hardwareSistemi   lezione i - Presentazione - hardware
Sistemi lezione i - Presentazione - hardware
 
Sistemi lezione viii - google altri servizi
Sistemi   lezione viii - google altri serviziSistemi   lezione viii - google altri servizi
Sistemi lezione viii - google altri servizi
 
Sistemi lezione xi - picasa web album - social bookmarking - notizie 2
Sistemi   lezione xi - picasa web album - social bookmarking - notizie 2Sistemi   lezione xi - picasa web album - social bookmarking - notizie 2
Sistemi lezione xi - picasa web album - social bookmarking - notizie 2
 
Sistemi lezione x - introduzione al web 2.0 - flickr
Sistemi   lezione x - introduzione al web 2.0 - flickrSistemi   lezione x - introduzione al web 2.0 - flickr
Sistemi lezione x - introduzione al web 2.0 - flickr
 
Sistemi di elaborazione dell'informazione - Google Docs basics
Sistemi di elaborazione dell'informazione - Google Docs basicsSistemi di elaborazione dell'informazione - Google Docs basics
Sistemi di elaborazione dell'informazione - Google Docs basics
 

Recently uploaded

4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptxJonalynLegaspi2
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17Celine George
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptxmary850239
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 

Recently uploaded (20)

4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
week 1 cookery 8 fourth - quarter .pptx
week 1 cookery 8  fourth  -  quarter .pptxweek 1 cookery 8  fourth  -  quarter .pptx
week 1 cookery 8 fourth - quarter .pptx
 
How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17How to Fix XML SyntaxError in Odoo the 17
How to Fix XML SyntaxError in Odoo the 17
 
4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx4.11.24 Mass Incarceration and the New Jim Crow.pptx
4.11.24 Mass Incarceration and the New Jim Crow.pptx
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 

Lesson 02 - React Native Development Environment Setup

  • 1. Laboratorio Avanzato di Programmazione II (LAP II) Sviluppo di applicazioni mobili native multipiattaforma Prof. Antonio S. Calanducci Corso di Laurea in Informatica, Unict Anno accademico 2017/18 Lesson 02: React Native Development Environment Setup
  • 2. Step 1: Expo XDE Expo is an open source toolchain that simplify mobile app development with React Native • Made up of several components Download Expo XDE (Expo Development Environment) from: • https://github.com/expo/xde/releases • Choose xde-Setup-2.22.1.exe for Win 10 • Choose xde-2.22.1-x86_64.AppImage for Linux • Choose xde-2.22.1.dmg for Mac OS Run the installer (Win) Open the dmg and drag "Expo XDE" on the Application folder (MacOS) Move the AppImage in your preferred location, "chmod +x xde-2.22.1-x86_64.AppImage", and start it Open XDE. At the first run, you need to set up a free account
  • 3. Step 2: Expo clients apps Expo clients allow to test, debug and run apps built with Expo on your physical iOS and Android devices and/or iOS simulator/Android emulators • It will reload automatically the app every time your source code changes From your iOS/Android devices download: • https://itunes.apple.com/app/apple-store/id982107779? ct=www&mt=8 • https://play.google.com/store/apps/details? id=host.exp.exponent&referrer=www
  • 4. Step 3: Run the "Hello World" app Open Expo XDE Create a new project • choose the blank template • use hello-world as project name Click on the Share button Open the Expo client on your device • click on Scan QR code option and point to your dev machine screen
  • 5. Step 3: Install a Code Editor Here my preferred ones: • Atom (https://atom.io) - macOS/Win/Linux • Visual Studio Code (https://code.visualstudio.com) - macOS/Win/Linux • Sublime Text 3 (https://www.sublimetext.com) - macOS/ Win/Linux
  • 6. Step 3: Visual Studio Code Download Visual Studio Code from: • https://code.visualstudio.com VS Code optionally requires a GIT client If you are using Linux, install with your Package manager (apt-get install git) On Mac OS, git comes pre-installed with Xcode For Windows, go to the next slide :)
  • 7. Step 4: Chocolatey (Win) Chocolatey is a Package Manager for Windows • Easily manage all aspects of Windows software (installation, configuration, upgrade, and uninstallation) Installation instructions (https://chocolatey.org/install): • Open Command Prompt as Administrator (Run As Admin) • Copy and Paste the following text: • @"%SystemRoot%System32WindowsPowerShellv1.0powershell.exe" - NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New- Object System.Net.WebClient).DownloadString('https://chocolatey.org/ install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%chocolateybin"
  • 8. Step 5: Install Git Install GIT with with one of the following way: • Download and run the installer from • https://git-scm.com/downloads • Use Chocolatey (recommended): • From the Command prompt, type: • choco install -y git -params '"/GitAndUnixToolsOnPath"'
  • 9. Step 6: Node.js installation (Windows) Several ways: • via Chocolatey (recommended) • download from https://chocolatey.org • choco install nodejs.install • with Windows installer at (easier): • https://nodejs.org/en/download/
  • 10. Step 6: Node.js installation (Linux/macOS) Several ways: • with Node Version Manager (nvm): • (Linux): $ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/ install.sh | bash • (MacOS): $ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/ install.sh | bash • $ source ~/.profile (or source ~/.bash_profile for Mac OS) • $ nvm install 8 • more info here: https://github.com/creationix/nvm#install-script • via Package Manager: • https://nodejs.org/en/download/package-manager/ • using a pre-built installer: • https://nodejs.org/en/download/
  • 11. Node.js installation (macOS) Via Homebrew (the missing package manger for macOS): • $ /usr/bin/ruby -e "$(curl -fsSL https:// raw.githubusercontent.com/Homebrew/install/ master/install)” • $ brew install node • Info on Homebrew here: https://brew.sh
  • 12. Step 7 (optional): install Genymotion Genymotion is a Android emulator it’s free for educational purpose and personal usage: Download the Personal Edition and install it from: • https://www.genymotion.com/fun-zone/ You need to create a free account VirtualBox is required (download and install VBox first) • so it cannot be run in a virtualized host
  • 13. Step 7 (optional): Genymotion configuration Start Genymotion Click "Add" to add a new virtual device Choose one of Start the Virtual device From the left bar, click on GApps • this will install the Google Services and the Play Store • Install Expo from the Play Store
  • 14. Step 8: Visual Studio Code extensions https://medium.com/react-native-training/vscode-for-react- native-526ec4a368ce React Native Tools Prettier Auto Close Tag Auto Complete Tag Color Highlight Path Intellisense Babel JavaScript or Sublime Babel
  • 15. Linter (ESLint) Code linting is a type of static analysis that is frequently used to find problematic patterns or code that doesn’t adhere to certain style guidelines • JavaScript, being a dynamic and loosely-typed language, is especially prone to developer error • Linting tools like ESLint allow developers to discover problems with their JavaScript code without executing it
  • 16. Step 9a (optional): ESLint installation Atom: • packages to install: “linter”, “linter-eslint” Visual Studio Code • (from a terminal:) $ npm install -g eslint • extension to install: “ESLint”
  • 17. Step 9b (optional): ESlint configuration In your project directory: • eslint --init And choose the following answers: • Use a popular style guide • Airbnb • Do you use React? Y • JSON { "extends": "airbnb", "rules": { "react/jsx-filename-extension": [ 2, { "extensions": [".js", ".jsx"] } ] } } Modify .eslintrc.json: { "editor.formatOnSave": true, "prettier.eslintIntegration": true } edit VSCode User Preferences:
  • 18. Step 10 (optional): Expo CLI Sometimes it's quicker to start the React Native packager without opening the XDE, using a terminal VSCode has an integrated terminal too From a terminal: • $ npm install -g exp
  • 19. Test your installation Open the "Hello World" project folder from your editor Start the React Native packager from XDE or with: • $ exp start Start Genymotion (and/or the iOS Simulator if you are on a Mac): • Open the Expo client, switch to the "Explore" tab, click on the Search icon • Copy and paste the URL from XDE (es: exp://192.168.1.6:19000) Do a simple edit in the code and see if the app refreshes
  • 20. Expo tips on iOS: Cmd+D shows the Expo debug menu on iOS: Cmd+R reloads the app on Genymotion: Ctrl+M shows the Expo debug menu (R,R, reloads the app) Enable Live Reload or Hot Reload (only one of the two): • every time you save a file, Expo will reload the app If you want to reload faster, switch to LAN
 (if you are connected to the same LAN!)
  • 21. Snack if you don’t want to install anything on your machine and learn React Native anyway, you can use Snack at: • https://snack.expo.io Use Expo apps on your iOS and Android devices