📺 Develpreneur YouTube Episode

Video + transcript

React Native Getting Started - Installation

2021-09-14 •Youtube

Detailed Notes

Started Using React Native For Your Mobile Applications begins our new segment on React-Native. In this introductory episode we begin our journey by looking at what React Native is and why you should consider React Native for Mobile Development. Followed by a complete hands on session covering everything you need to get started, environments setup, libraries, etc. Once we're done with the setup we jump right into what you need to begin writing your first application.

In this episode, we focus on installation and general getting started.

What is React-Native

React Native is an open-source mobile application framework created by Facebook, Inc. It is used to develop applications for Android, Android TV, iOS, macOS, tvOS, Web, Windows and UWP by enabling developers to use React's framework along with native platform capabilities.

What React Native Can Do? 1. Establishes Platform Independence

React Native was initially developed by Facebook to sustain iOS. However, it now supports all the methods specific to the Android operating system. So, it’s just like building a native app with a single codebase that works on both iOS and Android platforms.

2. Readily Available Reusable Components

Built with re-usability at its core, React Native enables you to make use of plug and play like features corresponding to iOS and Android. This makes the app architecture consistent with the following features:

Responsive UI and UX Web-like style of development as compared to hybrid frameworks Look, speed and feel of the native widgets 3. Revamp Existing Code

You can apply the UI components of React Native to an app code that already exists. This is an added advantage to businesses that need to supplement an app that exists but do not want to rebuild it. Embedding React Native UI components is a quick process and does not require re-writing.

4. Fast Compilation Through Hot Reloading

JavaScript is one of the fastest programming languages. It introduces another unique concept of Hot Reloading to provide better development experience. This feature combines the small compilation time of JavaScript and other capabilities. That means, you can make edits simultaneously without having to recompile it altogether. React Native brings the speed and agility of web app to the hybrid space and with the results of a native app.

What React Native Can’t Do? 1. Not Fully Scaled for Custom Modules

React Native has not addressed all its glitches. It also has missing custom modules which may take a lot of your time to build as well as to create modules of your own. You will require a specialized developer to address the technical challenges and bugs from time to time.

2. Guarantee Certainty

Even if Facebook has a developed framework, there is an uncertainty of its permanence because it still has the rights to do away with the project at any time. However, this is not likely to occur because of the technology popularity it has gained with time.

3. Handling Complex UI and Background Processing

If your apps are more interaction-intensive, then React Native might not be able to provide the best native experience. Also, apps that require a lot of background processes to work should not be built with React Native. It is even harder to get that performance benchmark for heavier apps.

4. Mitigate Heavy CPU Usage

React Native works on the interconnected Native and JavaScript modules that combine the power of script compilation and provide a native feel to the app. This process is highly CPU intensive and is a major cause of low app performance.

When To Started Using React Native Apps React Native should only be used for apps that fit into these categories: Traditional native-like apps for cross platforms with lesser views Less Hardware API access Budget apps Apps that require short development cycle When To Build Native Apps

Native apps should be your first choice if you have a budget that supports long term app development without compromising on specific features like:

Faster and heavy calculations Multi-threaded processes Easy and parallel updates with SDKs Strongly coded app with less bugs Apps with heavy UI and a lot of animations

Additional Resources React - https://reactjs.org/ Node - https://nodejs.org/en/ Visual Studio Code - https://code.visualstudio.com/ Android Development - https://developer.android.com/studio Xcode - https://apps.apple.com/us/app/xcode/id497799835?mt=12

Transcript Text
[Music]
so welcome today we are going to be
talking about react native and this is
just kind of like getting started a
quick look at
setting up react native and just
starting to code mobile apps using react
today we are going to cover what is
react native
why you should consider using react
native for your mobile development
versus native
uh development
we're going to basically go through kind
of a quick start guide and getting
started approach to using react native
we're going to look at the basics and
basically build a hello world now within
this process we're also going to be
looking at setting up your environment
today
primarily we're going to be using a mac
ios environment so that i can show you
how to use ios
so you can actually test your apps with
ios and then in future classes i'm going
to actually port all of this over to a
raspberry pi
using linux and then i'll show you how
to do all your development using a linux
raspberry pi
let's start out by talking about what is
react native well react native is an
open source mobile application framework
created by facebook
it is used to develop applications for
android android tv ios mac os tv os and
so on uh it can also be used for windows
and uwp by enabling developers to use
react's framework along with native
platform capabilities so basically this
falls along the concepts of typical
javascript modules or java where you
essentially write one application and
then you can deploy deploy it to
multiple devices
so first we're going to look at what you
can and cannot do
or really what you should use react
native for versus native applications
so first let's talk about what react
native can do
well it can establish a platform
independence so react native was
initiated
excuse me it was initially developed by
facebook to sustain ios
however it now supports all the methods
specific to the android operating system
so it's just like bundling a native app
with a single code base that works on
both ios and android platforms
next it's readily available reusable
components
it comes with a built in
or built with reusable
reusability at its core
react native enables you to make use of
the plug employee like features
corresponding to ios and android this
makes the app architecture consistent
with the following features
responsive ui
and ux capabilities
web-like style of development as
compared to a hybrid framework
look speed and feel of the native
widgets
next we have we can use it for revamped
existing code base
you can apply the ui components of react
native to an app code that already
exists
this is an added advantage to the
business that needs to supplement an app
that exists but do not want to rebuild
it
embedding react native ui components is
a quick process and does not require
rewriting
next we have fast compilation through
hot reloading
and we'll see this in today's example
here javascript is one of the fastest
programming languages it introduces
another unique concept of hot reloading
to provide better development experience
this feature combines the small
compilation time of javascript and other
capabilities
that means you can edit simultaneously
without having to recompile your code
base
also react native brings the speed and
agility of web apps to the hybrid space
and with the results of a native app
now react native
cannot
what you really should be looking at uh
native apps when you run into these
these particular categories
not fully scalable for custom modules
now here we're talking about where react
native has not addressed all of its
glitches yet it has also missed
it's also missing some of the custom
modules which may take a lot of your
time to build as well as to create
modules of your own
you will require a specialized developer
to address the technical challenges and
bugs from time to time
guarantee certainty
well even if facebook has a development
framework this is an uncertainty of its
performance because it still has the
rights to do away with the project at
any time
however this is not likely to occur
because of the technology is so popular
and is only gain more popularity over
time but again you have to remember this
is a
third-party tool so if the third party
decides to get rid of it you're sol you
have to basically go back to native
react native
is not great at handling complex ui and
background processing
if your apps are more integration or
intensive then react native might not be
able to provide the best native
experience
also apps that require a lot of
background processing to work should not
be built with react native
it is even harder to get that
performance benchmark for heavier apps
and finally mitigating heavy cpu usage
react native works on the interconnected
native and javascript modules that
combine the power of script combination
and provide a native feel to the app
the higher process in highly cpu
intensive
applications and is a major cause of low
app performance
so when should we
really use react native to build our
apps
well react native should only be used
for apps to fit into these categories
typically traditional native like apps
for cross-platform with lesser views
less hardware api access
budget apps
and apps that require shorter
development cycles
next let's look at when we really need
to build native apps versus react native
native apps should be your first choice
if you have a budget that supports
long-term app development without
compromising on specific features for
instance
fast and heavy calculations
multi-threaded processing
easy and parallel updates with sdks
strong code apps with less bugs
and apps with heavy ui and lots of
animations
now in order to use react native we need
some additional resources
so i've listed them here so we need
react nodejs
visual studios code
android sdk and xcode
now visual studio's code is the only one
that's kind of optional in this case
because you can really use any
uh text editor to edit your code but
visual studio's code really seems to be
kind of the de facto uh editor for react
and react native it's just so easy to
use and you'll see that today
so let me go over these real quick so
you can understand what each of these
are
so let's start with react
so react is an open source front end
javascript library for building user
interfaces or ui components it is
maintained by facebook and a community
of individual developers and companies
react can be used as a base in the
development of single page or mobile
applications
now in order to install react native and
to use some of its command line tools we
need to install node.js
node.js is an open source
cross-platform back-end javascript
runtime environment that runs on chrome
version 8 engine and executes javascript
code outside of a web browser
now for our editor like i said we're
going to be using visual studio's code
and visual studio's code is a free
source code editor made by microsoft for
windows
linux and mac os
its features include supporting for
debugging syntax highlighting
intelligence code compilation snippets
code refactoring and embedded get
in our case it also has some
react and react native libraries that we
can use for code editing
next we need our android software
development environment sdk
this is the process by which
the applications are created for devices
running the android operating system
google states that android apps can be
written using copeland java and c plus
plus languages
using the android software development
kit
while using other languages is also
possible
now in our case here we aren't going to
be using the android sdk for its editor
capabilities we need the android sdk for
its uh visual emulators so that we can
actually run
a emulated android device
and last we have xcode which is mac only
xcode is apple's integrated development
environment for mac os
it's used to develop software for mac os
ios ipad watch os and tv os
it was first released in 2003 and the
latest stable release is version
12.3 or 14
uh
depending upon where you uh
which
device you have
and it's available via the mac app store
free of charge for mac os sir users
or even for
some of the previous versions of mac os
right now mac os big sur is the latest
and greatest
all right with that let's get started
with our hands-on demo
minimize this
[Music]
edge
all right so the first thing we need to
do is we need to get
nodes js so we just google nodes.js
and we want to go to
nodesjs.org
and you can download the current or the
latest
lts
that's available for node.js
you click the button it will download
via the linux or the windows version for
your machine
you double click and you just follow the
install process to install node.js
now i've already done this so i'm not
going to take you through the steps of
these installers but you can if you get
stuck you can easily go to the websites
and they will walk you through how to
set them up it's really straightforward
just click continue next and set a
destination
once installed we want to open up our
terminal
and type in node to make sure that it is
installed now here we will see welcome
to node.js
and we currently have 14 15 4 installed
which is the latest
lts version
all right ctrl c twice to exit out
alright next we want to go to react
native
we google react native and it is react
native.dev
and this is the site that you will
probably spend most of your time on it
has a slew of information not only does
it give you steps on how to install the
software
it also gives you
your online documentations for how to
use react native
it walks you through environment setups
which we're going to go through some of
these today
it also gives you different workflows on
how to run on the device we're going to
cover a few of these as well
also it gives you design
recommendations interactions and so on
it also gives you the components library
so these are all the specific components
you can use for building react native
apps
things like views text adding images
adding text inputs scroll views and
style
adding
user interface buttons or switches
list views and specific components for
android or ios
and it also has some other javascript
libraries like modals alert boxes
status bars and so on
and it also has a fast api of
code library of things that you can
actually use when building your react
native applications
and if you ever get stuck you can always
go out to react community read what's uh
some of the latest
news
or changes that are going on in the
community and some of these have uh
slack channels and things like that that
you can go out to and actually ask
questions and get help
all right so let's go back over to the
documentation and let's go to
setting up a device
so there are two ways you can actually
install
react native if you are new to
development you want to use the expo
command line interface
otherwise if you are already have been
developing mobile apps for some time
you'll want to start with the native cli
now
starting with the expo versus react
native really just kind of simplifies
what your project looks like but at any
given time if you need a more complex
uh or your app gets more complex or you
have to do
unique integration
components with android or ios you can
easily convert your expo app into a
native cli app
for today we're going to focus strictly
on expo this gets you started quickly
and you can just kind of start diving in
and playing around on your local systems
so here we're going to go out to our
command line and essentially follow
these steps
go back out to terminal here
so the first thing you need to do is
once you've installed node you're going
to use npm
and we're going to install
sg
xo or export
dli
and this will take just a minute to
install
now one thing i'm going to stop this i'm
going to redo it because it's going to
come back and it's going to yell at me
because i'm on a mac and my security
settings are very strict so i need to
preface this with sudo
now you may have the same issue on linux
windows is a little more forgiving you
should be able to just enter npm from
the command line
now since i already had this installed
it just went ahead and updated one
package so that i have the latest
version of everything and once it's
finished let's make sure that it's there
so we'll do
npm
all right notes there
and expo
there we go
and expo is installed
you type npm that checks to make sure
nodes install
and expo checks
to see if expo is installed if it's not
you'll get an error command not found
you
Transcript Segments
1.28

[Music]

27.279

so welcome today we are going to be

29.119

talking about react native and this is

31.599

just kind of like getting started a

34.079

quick look at

35.68

setting up react native and just

37.92

starting to code mobile apps using react

43.44

today we are going to cover what is

45.52

react native

47.2

why you should consider using react

48.96

native for your mobile development

50.559

versus native

51.92

uh development

53.44

we're going to basically go through kind

54.879

of a quick start guide and getting

56.879

started approach to using react native

60.079

we're going to look at the basics and

62.32

basically build a hello world now within

64.96

this process we're also going to be

66.64

looking at setting up your environment

69.119

today

70.08

primarily we're going to be using a mac

72.479

ios environment so that i can show you

74.4

how to use ios

77.759

so you can actually test your apps with

79.439

ios and then in future classes i'm going

82.4

to actually port all of this over to a

85.52

raspberry pi

87.119

using linux and then i'll show you how

89.04

to do all your development using a linux

92.159

raspberry pi

96.799

let's start out by talking about what is

98.64

react native well react native is an

101.36

open source mobile application framework

103.92

created by facebook

105.68

it is used to develop applications for

108.32

android android tv ios mac os tv os and

112.96

so on uh it can also be used for windows

116.479

and uwp by enabling developers to use

119.84

react's framework along with native

122.159

platform capabilities so basically this

124.64

falls along the concepts of typical

126.88

javascript modules or java where you

131.039

essentially write one application and

133.12

then you can deploy deploy it to

135.12

multiple devices

139.2

so first we're going to look at what you

140.8

can and cannot do

143.12

or really what you should use react

145.28

native for versus native applications

150.319

so first let's talk about what react

152.879

native can do

155.2

well it can establish a platform

157.2

independence so react native was

160.16

initiated

162.319

excuse me it was initially developed by

165.68

facebook to sustain ios

168.48

however it now supports all the methods

171.36

specific to the android operating system

174.08

so it's just like bundling a native app

176.319

with a single code base that works on

178.08

both ios and android platforms

181.76

next it's readily available reusable

185.04

components

186.8

it comes with a built in

189.519

or built with reusable

192.239

reusability at its core

194.48

react native enables you to make use of

197.04

the plug employee like features

199.28

corresponding to ios and android this

202.239

makes the app architecture consistent

204.48

with the following features

206.4

responsive ui

208

and ux capabilities

210.799

web-like style of development as

213.12

compared to a hybrid framework

215.599

look speed and feel of the native

218

widgets

220.159

next we have we can use it for revamped

223.36

existing code base

225.28

you can apply the ui components of react

227.84

native to an app code that already

230

exists

231.12

this is an added advantage to the

232.959

business that needs to supplement an app

236

that exists but do not want to rebuild

238.64

it

239.68

embedding react native ui components is

242

a quick process and does not require

244.08

rewriting

247.04

next we have fast compilation through

249.28

hot reloading

251.519

and we'll see this in today's example

254.56

here javascript is one of the fastest

256.88

programming languages it introduces

259.44

another unique concept of hot reloading

262.16

to provide better development experience

264.96

this feature combines the small

266.72

compilation time of javascript and other

269.36

capabilities

270.88

that means you can edit simultaneously

273.44

without having to recompile your code

275.52

base

277.04

also react native brings the speed and

279.68

agility of web apps to the hybrid space

282.639

and with the results of a native app

290.24

now react native

292.08

cannot

294.4

what you really should be looking at uh

296.72

native apps when you run into these

300.24

these particular categories

302.88

not fully scalable for custom modules

306.479

now here we're talking about where react

308.56

native has not addressed all of its

310.8

glitches yet it has also missed

313.759

it's also missing some of the custom

315.6

modules which may take a lot of your

318.16

time to build as well as to create

320.16

modules of your own

322.08

you will require a specialized developer

324.16

to address the technical challenges and

326.16

bugs from time to time

329.44

guarantee certainty

331.199

well even if facebook has a development

333.68

framework this is an uncertainty of its

337.12

performance because it still has the

339.68

rights to do away with the project at

342.24

any time

343.44

however this is not likely to occur

345.52

because of the technology is so popular

347.919

and is only gain more popularity over

350.4

time but again you have to remember this

352.88

is a

354.479

third-party tool so if the third party

356.8

decides to get rid of it you're sol you

359.36

have to basically go back to native

363.6

react native

365.28

is not great at handling complex ui and

368.24

background processing

370.319

if your apps are more integration or

372.96

intensive then react native might not be

375.759

able to provide the best native

377.6

experience

378.88

also apps that require a lot of

380.8

background processing to work should not

383.039

be built with react native

385.44

it is even harder to get that

387.039

performance benchmark for heavier apps

391.68

and finally mitigating heavy cpu usage

395.919

react native works on the interconnected

398.479

native and javascript modules that

400.56

combine the power of script combination

403.199

and provide a native feel to the app

406.16

the higher process in highly cpu

408.8

intensive

410.639

applications and is a major cause of low

413.44

app performance

419.28

so when should we

421.36

really use react native to build our

423.44

apps

424.479

well react native should only be used

426.8

for apps to fit into these categories

429.759

typically traditional native like apps

432.8

for cross-platform with lesser views

435.84

less hardware api access

439.12

budget apps

441.12

and apps that require shorter

442.639

development cycles

447.52

next let's look at when we really need

449.28

to build native apps versus react native

454.479

native apps should be your first choice

456.72

if you have a budget that supports

458.4

long-term app development without

460.16

compromising on specific features for

462.8

instance

463.759

fast and heavy calculations

466

multi-threaded processing

468.319

easy and parallel updates with sdks

471.84

strong code apps with less bugs

474.879

and apps with heavy ui and lots of

477.12

animations

486

now in order to use react native we need

488.56

some additional resources

491.759

so i've listed them here so we need

494.56

react nodejs

496.8

visual studios code

498.72

android sdk and xcode

501.599

now visual studio's code is the only one

503.68

that's kind of optional in this case

505.44

because you can really use any

507.52

uh text editor to edit your code but

510.56

visual studio's code really seems to be

513.039

kind of the de facto uh editor for react

516.8

and react native it's just so easy to

518.88

use and you'll see that today

521.039

so let me go over these real quick so

523.279

you can understand what each of these

525.279

are

526

so let's start with react

529.36

so react is an open source front end

532.72

javascript library for building user

535.04

interfaces or ui components it is

538.16

maintained by facebook and a community

540.72

of individual developers and companies

543.6

react can be used as a base in the

546.16

development of single page or mobile

548.399

applications

550.16

now in order to install react native and

552.64

to use some of its command line tools we

555.12

need to install node.js

558

node.js is an open source

560.839

cross-platform back-end javascript

563.12

runtime environment that runs on chrome

566

version 8 engine and executes javascript

569.04

code outside of a web browser

572.16

now for our editor like i said we're

574.16

going to be using visual studio's code

576.56

and visual studio's code is a free

579.44

source code editor made by microsoft for

582.16

windows

583.279

linux and mac os

585.519

its features include supporting for

587.44

debugging syntax highlighting

589.839

intelligence code compilation snippets

592.72

code refactoring and embedded get

595.519

in our case it also has some

597.76

react and react native libraries that we

599.839

can use for code editing

603.68

next we need our android software

605.839

development environment sdk

608.48

this is the process by which

610.72

the applications are created for devices

613.44

running the android operating system

616.079

google states that android apps can be

619.2

written using copeland java and c plus

622.32

plus languages

624

using the android software development

625.839

kit

627.36

while using other languages is also

629.519

possible

630.72

now in our case here we aren't going to

632.959

be using the android sdk for its editor

636

capabilities we need the android sdk for

639.68

its uh visual emulators so that we can

643.2

actually run

644.399

a emulated android device

648.48

and last we have xcode which is mac only

653.76

xcode is apple's integrated development

656.16

environment for mac os

658.16

it's used to develop software for mac os

661.36

ios ipad watch os and tv os

665.6

it was first released in 2003 and the

668.399

latest stable release is version

671.04

12.3 or 14

673.36

uh

674.48

depending upon where you uh

677.279

which

678.64

device you have

680.8

and it's available via the mac app store

683.12

free of charge for mac os sir users

687.44

or even for

689.519

some of the previous versions of mac os

691.36

right now mac os big sur is the latest

693.76

and greatest

696.88

all right with that let's get started

699.12

with our hands-on demo

705.6

minimize this

710.72

[Music]

712.079

edge

717.76

all right so the first thing we need to

719.2

do is we need to get

721.36

nodes js so we just google nodes.js

725.68

and we want to go to

728.16

nodesjs.org

733.36

and you can download the current or the

736.24

latest

737.519

lts

738.72

that's available for node.js

741.76

you click the button it will download

744.56

via the linux or the windows version for

746.88

your machine

748.079

you double click and you just follow the

750

install process to install node.js

752.88

now i've already done this so i'm not

754.72

going to take you through the steps of

756

these installers but you can if you get

758.72

stuck you can easily go to the websites

760.639

and they will walk you through how to

762.16

set them up it's really straightforward

764.16

just click continue next and set a

766.72

destination

769.36

once installed we want to open up our

771.519

terminal

779.2

and type in node to make sure that it is

781.279

installed now here we will see welcome

783.68

to node.js

785.279

and we currently have 14 15 4 installed

788.32

which is the latest

790.639

lts version

797.279

all right ctrl c twice to exit out

807.839

alright next we want to go to react

810.16

native

813.04

we google react native and it is react

816.24

native.dev

820.56

and this is the site that you will

821.839

probably spend most of your time on it

824.24

has a slew of information not only does

827.12

it give you steps on how to install the

829.279

software

830.399

it also gives you

832.56

your online documentations for how to

835.04

use react native

836.88

it walks you through environment setups

838.56

which we're going to go through some of

839.68

these today

841.04

it also gives you different workflows on

843.279

how to run on the device we're going to

845.04

cover a few of these as well

847.279

also it gives you design

850.079

recommendations interactions and so on

853.12

it also gives you the components library

855.279

so these are all the specific components

857.36

you can use for building react native

859.6

apps

861.68

things like views text adding images

865.36

adding text inputs scroll views and

867.92

style

869.36

adding

870.639

user interface buttons or switches

873.76

list views and specific components for

876.48

android or ios

878.959

and it also has some other javascript

882.16

libraries like modals alert boxes

885.6

status bars and so on

888.48

and it also has a fast api of

893.04

code library of things that you can

894.639

actually use when building your react

897.6

native applications

899.68

and if you ever get stuck you can always

901.36

go out to react community read what's uh

904.399

some of the latest

905.68

news

906.959

or changes that are going on in the

908.399

community and some of these have uh

910.72

slack channels and things like that that

912.32

you can go out to and actually ask

913.68

questions and get help

917.68

all right so let's go back over to the

918.88

documentation and let's go to

922

setting up a device

924.959

so there are two ways you can actually

927.12

install

929.519

react native if you are new to

931.519

development you want to use the expo

934.079

command line interface

935.839

otherwise if you are already have been

938.079

developing mobile apps for some time

940.079

you'll want to start with the native cli

944.079

now

944.959

starting with the expo versus react

948.16

native really just kind of simplifies

950.88

what your project looks like but at any

953.279

given time if you need a more complex

956.56

uh or your app gets more complex or you

958.959

have to do

960.48

unique integration

962.24

components with android or ios you can

965.12

easily convert your expo app into a

968

native cli app

969.759

for today we're going to focus strictly

971.519

on expo this gets you started quickly

974.079

and you can just kind of start diving in

976.24

and playing around on your local systems

980.079

so here we're going to go out to our

982.079

command line and essentially follow

983.92

these steps

985.36

go back out to terminal here

988.079

so the first thing you need to do is

989.92

once you've installed node you're going

991.68

to use npm

993.92

and we're going to install

995.839

sg

997.519

xo or export

1001.44

dli

1002.56

and this will take just a minute to

1004.079

install

1005.12

now one thing i'm going to stop this i'm

1007.12

going to redo it because it's going to

1009.04

come back and it's going to yell at me

1011.04

because i'm on a mac and my security

1013.279

settings are very strict so i need to

1016.16

preface this with sudo

1021.44

now you may have the same issue on linux

1024.559

windows is a little more forgiving you

1026.72

should be able to just enter npm from

1028.559

the command line

1030

now since i already had this installed

1031.679

it just went ahead and updated one

1033.6

package so that i have the latest

1036

version of everything and once it's

1037.919

finished let's make sure that it's there

1040.16

so we'll do

1041.6

npm

1047.28

all right notes there

1051.28

and expo

1053.679

there we go

1055.039

and expo is installed

1061.039

you type npm that checks to make sure

1063.2

nodes install

1064.72

and expo checks

1067.039

to see if expo is installed if it's not

1068.96

you'll get an error command not found

1087.6

you