38
Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile.

Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

Building native mobile apps with Angular 2.0 and NativeScriptYou know Angular. Now you know mobile.

Page 2: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

Lohith G N

Technical Evangelist

[email protected]

Page 3: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist
Page 4: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

The first entry from the Google docs

Page 5: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

Platform SpecificPlatform Agnostic

MarkupDom

AdapterCompiler

Proto Views

RendererVisual Tree

Angular 2 meets NativeScript

HTML Parse5 CompilerProto

Views

NativeScript Renderer

Native

Visual Tree

Page 6: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

NativeScript Checkbox with Angular 2

Page 7: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

an open source framework for building truly

native mobile apps with JavaScript. Use web

skills, like TypeScript, Angular and CSS, and get

native UI and performance on iOS and Android.

NativeScript is…

Page 8: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

The {N} difference…

Page 9: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

Search for

“Examples NativeScript”

in the iOS App Store or Google

Play to try this out for yourself.

Rich, animated,

“no compromise”

native UI(with shared UI code)

1

Page 10: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

Maximum code

and skill

reusability

2

Video credit: Nathan Walker, {N} community member

Page 11: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

First-class Angular and TypeScript support3

+ =

Page 12: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

Android iOS

Web

Page 13: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

100% access to

Android and

iOS APIs

4

Page 14: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

Runs on V8 JavaScript VM

Runs on JavaScriptCore VM

More details at http://bit.ly/how-nativescript-works

Page 15: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

Calling Android API

Page 16: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

Calling Android API

Page 17: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

Calling Android API

Page 18: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

Calling Android API

Page 19: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

Calling Android API

Page 20: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

Metadata Generating Process

M

G

P

=

Page 21: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

NativeScript modulesCode Modules Platform API

Page 22: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

One UI syntax for all

Page 23: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

Example: NativeScript file module

Page 24: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

NativeScript Modules—There are a lot

Page 25: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

HTTP module example

Page 26: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

De

sti

nati

on

Imp

lem

en

tati

on

Ab

str

ac

tio

n

La

ye

r

The big picture

XMLHttpRequest

<NS Module>

Native

iOS call

Native

Android call

iOS App Android App

Page 27: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

De

sti

nati

on

Imp

lem

en

tati

on

Ab

str

ac

tio

n

La

ye

r

The bigger picture

HTTP

<Angular Component>

XMLHttpRequest

<NS Module>

Native

iOS call

Native

Android callAjax call

iOS App Android App Web App

XMLHttpRequest

<Browser>

Page 28: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

One syntax for all

Attribute Binding: [attribute]

Event Binding: (event)

Intercepting input: #idhandler

Conditions: *ngIf="expression"

Loops: *ngFor="expression"

Styling: [class.style1]="expression"

Page 29: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

CSS

Page 30: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

http://docs.nativescript.org/styling#supported-

properties

Page 31: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

The difference is in the UI

Web UI != Mobile UI

Page 32: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

Native LayoutsAbsolute Dock Grid Stack Wrap

Page 33: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

DEMO

Page 34: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

2013 2014 2015 2016 2017

Early

prototypes

“Core”

engineering

Public

launch

Adoption

ramp-up

Mass

adoption

Project Timeline

Page 35: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

Join the growing

NativeScript

community on Slack

bit.ly/nativescript-slack

Page 36: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

https://twitter.com/nativescript

Page 37: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist

Q & A

Page 38: Building native mobile apps with Angular 2.0 and ... · Building native mobile apps with Angular 2.0 and NativeScript You know Angular. Now you know mobile. Lohith G N Technical Evangelist