SlideShare a Scribd company logo
Nativescript
for Angular2
Chris Noring
Google Developer Expert
Front end Developer
at OVO Energy
About me
chris_noring
What’s out there for building
apps?
App store and market place = plan for monetizing
+ It also has
Built in features like
camera,
gps,
push notifications
+ Has access to
Native
swift, objective-c
java
- Usually needs
one dev team per platform $$$
Web apps
One team, only needs to know javascript + css
+ Cost less
- Limited access to hardware
- Browser support, increase maintenance and dev time
- Monetizing?
Will cost time and money to make it work well on all browsers also conti
- Doesn’t feel like native, its a compromise
+ Great for simple scenarios like a responsive version of t
geoposition
Hybrid frameworks
- You need to learn its api
rendering in web views, not truly native UI
+ It is possible to use an App Store
- Limited access to hardware
but the support is getting better and better
WebRTC*
WebGL
WebAudio
IndexedDB
Web Components*
Utilize Hardware Acceleratio
Remote Debugging*
- More and more cool features
are being supported
just a regular mobile optimized website, written in CSS, HTML and JavaScript, that is display
Ionic
Cordova
Phonegap
Titanium React Native
Progressive web apps
+ Caches
Is this the future?
- Monetizing?
+ Feels like an app
- Not great support on Safari yet
+ Progressive enhancement
better features with better browser and better broadband
+ Push notifications
So how does nativescript fit
in?
It’s NOT web although javascript, so no DOM
It targets actual apis
Its supports hardware due to being actual native
BUT you can use your javascript and css skills
AND you can use your native developers because
THEY KNOW THE API
It’s NOT either javascript or native folks, ITS BOTH
Nativescript
killer features
You can style native ui with css
You can use javascript OR angular 2 with typescript
free and open source framework for building native iOS and Android apps using JavaScript and C
You can access native apis with javascript
it’s free
It has hardware accelerated animations
You can monetise cause you can use App Store and markets
It’s pluggable, you can use and write your own plugins
How does it work?
Nativescript runtime uses
Javascript virtual machines
executed by V8.
is JIT compiled and
v8 JavaScriptCore
Android iOS
how does v8 know what android.text.format.Time() is?
var time = new android.text.format.Time();
this is javascript
NativeScript uses it to
inject APIs that let you access native code.
nativescript
inject android/ios object to
v8 or Javascript Core
There are APIs on v8 that lets you affect the global scope
How to know what to inject?
JavaScriptCore has a similar mechanism that makes the same te
How to interpret the js code?
1) NativeScript uses reflection to build the list of the APIs that are av
invokes a callback that native script can intercept, in that interceptio
2) android.text.format.Time()
javascript code
corresponding c++ callback
invokes JNI-bridge to
talk to native API
Android
invokes native API
directly
iOS
In conclusion
Nativescript investigates what to inject and injects metadat
A callback is connected to each executed javascript that na
C++ code on Android targets JNI ( c++ becomes java ) that
C++ on iOS talks to native API directly
And presto
Nativescript consists of
modules
Modules
camera.android.js
camera.ios.js
camera-common.js
selects the correct one at runtime
require(‘camera’)
camera
node_modules/ tns-core-modules
module
module
camera …
usage
everything is made up of modules
How easy is it to get started?
Preparing your environment
npm install nativescript -g
Windows
ecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https
Mac
ruby -e "$(curl -fsSL https://www.nativescript.org/setup/mac)"
tns doctor
verify your installation
Continued..
For android install genymotion
https://www.genymotion.com/
set path to android SDK
First app
scaffold
or
tns create my-app-name --ng
creates angular2 app
git clone https://github.com/NativeScript/sample-Groceries.git
angular 2 app for nativescript
Scaffolding saves a lot of time
What is the dev experience
like?
We got a plugin for vs code so we can set break points
We can use hot reload, so code is recompiled and rede
We can write and run unit tests
Hot reload
tns livesync platform —watch
1) compiles app
2) deploys to emulator/ device
repeats 1) + 2) on changes
Debug
tns debug platform
starts platform specific debugger
with option —debug-brk
—debug-brk
—start
—stop —emulator
set breakpoint
perform action
Build and start the application
Start Node Inspector
Launch Chrome browser
tns debug platform
Remote chromium debugger for Eclipse
https://www.nativescript.org/nativescript-for-visual-studio-code
Plugin for vs code
ext install nativescript
How hard is it to accomplish
something?
So we can be productive with all these components
we code in angular 2
we can easily extend with plugins
we can write our own plugins
we got,
ui components, we got layouts,http, css animations, gestures, hardware and more..
Controls with ng2
<Label class="lbl" [text]="title"></Label>
<Button (tap)="click()" text="Save new hero"></Button>
<TextField [(ngModel)]="status"></TextField>
<ListView [items]="todos" (itemTap)="tapped($event)" >
<template let-item="item" let-odd="odd" let-even="even">
</template>
</ListView>
one-way binding
event binding
two-way binding
So angular 2 with some new components
File system
Whats possible?
Create, Read, Update, Delete on files and folders
import * as fs from "file-system";
var documents = fs.knownFolders.documents();
var myFile = documents.getFile("Test_Write.txt");
myFile.writeText("Something")
.then(function () { }, err {});
myFile.readText()
.then(function (content) {
}, err {});
do something with
retrieved content
File demo
Layout
AbsoluteLayout
DockLayout
GridLayout
StackLayout
WrapLayout
Components ends up
exactly where you want them
x,y
Arranges children to outer edges,
last child takes up remaining space
columns and rows
Horizontally or vertically
follows orientation til space is filled
then wraps them into new column/row
Navigation
Navigation
Navigation is angular 2 router
if you know how that works
then you know how to build the app
CSS
CSS
Application-wide css, app.css
Component-specific css
@Component({
styleUrls : [‘pages/examples/list-
demo.component.css']
})
@Component({
style : ‘’
})
https://docs.nativescript.org/angular/ui/styling.html
Inline css
<Button text="inline style" style="background-color: green;"></Button>
<Button backgroundColor=“lightgray" >
Plugins
What is a native script plugin?
plugin
file.android.ts
file.ios.ts
package.json
lookup iOS and java implementation of the same thing
[NSDate date] new Date()).toString()
and add to respective file.platform.ts
write js-ified code corresponding to native api
NsDate.date() (new java.util.Date()).toString()
Is an npm package,
published or not, that exposes a native API
http://developer.telerik.com/featured/creating-nativescript-plugins-in-types
Great article to get started
http://plugins.telerik.com/nativescript
Telerik verified marketplace
https://docs.nativescript.org/plugins/plugins
More details
tns plugin add <Plugin>
tns plugin remove <Plugin>
Add/Remove
https://www.thepolyglotdeveloper.com/2016/07/create-native-ios-and-andr
Hardware
Camera
import * as cameraModule from 'camera';
cameraModule.takePicture({
width: 300,
height: 300,
keepAspectRatio: true
})
.then((picture) => {
console.log('picture taken');
this.source = picture;
})
<Image [src]="source"
stretch="none"
horizontalAlignment="center" >
</Image>
take picture
import a reference
Display image in control
Camera demo
A word about images
file system
<Image src="~/images/logo.png" stretch ="none" />
relative to the app folder
url
<Image src="https://www.google.com/images/errors/logo_sm_2.png" />
resource
<Image src="res://logo" stretch ="none" />
App_Resources
Android
iOS
Should be placed in resp platform
Geoposition
tns plugin add nativescript-geolocation
Install the plugin
Check if its enabled,
then ask for permission
import * as geolocation from "nativescript-geolocation";
if (!geolocation.isEnabled()) {
geolocation.enableLocationRequest();
}
So much for enabling, how to use?
geolocation.getCurrentLocation({
desiredAccuracy: 3,
updateDistance: 10,
maximumAge: 20000,
timeout: 20000})
.then(function(loc) {
if (loc) {
alert("Current location is: " + loc);
console.log("Current location is: " + loc);
}
}, function(e){
console.log("Error: " + e.message);
});
get location,
returns a promise
And just use a plugin to show the location
tns plugin add nativescript-google-sdk
Use an actual device to test this one
Once enabled, ask for location
Animation
ctrl.animate({
opacity: 0,
backgroundColor: new Color("Blue"),
translate: { x: 200, y: 0 },
scale: { x: 2, y: 2 },
rotate: 180,
duration: 800,
delay: 20,
iterations: 1,
curve: enums.AnimationCurve.easeIn
})
.then(() => {
console.log('animation done');
this.ypos += 20;
})
We can Rotate, scale, change opacity ..
What can we do?
translate
rotate
repeat animation
when done
Animation demo
Nativescript let’s you code an actual native
app using the API you know
using javascript
Just remember this..
Thank you for listening

More Related Content

What's hot

From zero to hero with React Native!
From zero to hero with React Native!From zero to hero with React Native!
From zero to hero with React Native!
Commit University
 
Putting the Native in React Native - React Native Boston
Putting the Native in React Native - React Native BostonPutting the Native in React Native - React Native Boston
Putting the Native in React Native - React Native Boston
stan229
 
Native Script by Sebastian Witalec
Native Script by Sebastian WitalecNative Script by Sebastian Witalec
Native Script by Sebastian WitalecSimone Basso
 
Intro To React Native
Intro To React NativeIntro To React Native
Intro To React Native
FITC
 
React Native in a nutshell
React Native in a nutshellReact Native in a nutshell
React Native in a nutshell
Brainhub
 
Introduction to react native
Introduction to react nativeIntroduction to react native
Introduction to react native
Dani Akash
 
Getting Started with React Native (and should I use it at all?)
Getting Started with React Native (and should I use it at all?)Getting Started with React Native (and should I use it at all?)
Getting Started with React Native (and should I use it at all?)
Devin Abbott
 
A tour of React Native
A tour of React NativeA tour of React Native
A tour of React Native
Tadeu Zagallo
 
Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016
Adrian Philipp
 
Hands on react native
Hands on react nativeHands on react native
Hands on react native
Jay Nagar
 
React Native for ReactJS Devs
React Native for ReactJS DevsReact Native for ReactJS Devs
React Native for ReactJS Devs
Barak Cohen
 
React Native for multi-platform mobile applications - Matteo Manchi - Codemo...
React Native for multi-platform mobile applications  - Matteo Manchi - Codemo...React Native for multi-platform mobile applications  - Matteo Manchi - Codemo...
React Native for multi-platform mobile applications - Matteo Manchi - Codemo...
Codemotion
 
Intro to react native
Intro to react nativeIntro to react native
Intro to react native
ModusJesus
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
Waqqas Jabbar
 
React-Native for multi-platform mobile applications @ Codemotion Rome 2017
React-Native for multi-platform mobile applications @ Codemotion Rome 2017React-Native for multi-platform mobile applications @ Codemotion Rome 2017
React-Native for multi-platform mobile applications @ Codemotion Rome 2017
Matteo Manchi
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
Sambhu Lakshmanan
 
TypeScript
TypeScriptTypeScript
Lo mejor y peor de React Native @ValenciaJS
Lo mejor y peor de React Native @ValenciaJSLo mejor y peor de React Native @ValenciaJS
Lo mejor y peor de React Native @ValenciaJS
Marcel Kalveram
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
dvcrn
 
Creating books app with react native
Creating books app with react nativeCreating books app with react native
Creating books app with react native
Ali Sa'o
 

What's hot (20)

From zero to hero with React Native!
From zero to hero with React Native!From zero to hero with React Native!
From zero to hero with React Native!
 
Putting the Native in React Native - React Native Boston
Putting the Native in React Native - React Native BostonPutting the Native in React Native - React Native Boston
Putting the Native in React Native - React Native Boston
 
Native Script by Sebastian Witalec
Native Script by Sebastian WitalecNative Script by Sebastian Witalec
Native Script by Sebastian Witalec
 
Intro To React Native
Intro To React NativeIntro To React Native
Intro To React Native
 
React Native in a nutshell
React Native in a nutshellReact Native in a nutshell
React Native in a nutshell
 
Introduction to react native
Introduction to react nativeIntroduction to react native
Introduction to react native
 
Getting Started with React Native (and should I use it at all?)
Getting Started with React Native (and should I use it at all?)Getting Started with React Native (and should I use it at all?)
Getting Started with React Native (and should I use it at all?)
 
A tour of React Native
A tour of React NativeA tour of React Native
A tour of React Native
 
Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016Experiences building apps with React Native @DomCode 2016
Experiences building apps with React Native @DomCode 2016
 
Hands on react native
Hands on react nativeHands on react native
Hands on react native
 
React Native for ReactJS Devs
React Native for ReactJS DevsReact Native for ReactJS Devs
React Native for ReactJS Devs
 
React Native for multi-platform mobile applications - Matteo Manchi - Codemo...
React Native for multi-platform mobile applications  - Matteo Manchi - Codemo...React Native for multi-platform mobile applications  - Matteo Manchi - Codemo...
React Native for multi-platform mobile applications - Matteo Manchi - Codemo...
 
Intro to react native
Intro to react nativeIntro to react native
Intro to react native
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 
React-Native for multi-platform mobile applications @ Codemotion Rome 2017
React-Native for multi-platform mobile applications @ Codemotion Rome 2017React-Native for multi-platform mobile applications @ Codemotion Rome 2017
React-Native for multi-platform mobile applications @ Codemotion Rome 2017
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 
TypeScript
TypeScriptTypeScript
TypeScript
 
Lo mejor y peor de React Native @ValenciaJS
Lo mejor y peor de React Native @ValenciaJSLo mejor y peor de React Native @ValenciaJS
Lo mejor y peor de React Native @ValenciaJS
 
Introduction to React Native
Introduction to React NativeIntroduction to React Native
Introduction to React Native
 
Creating books app with react native
Creating books app with react nativeCreating books app with react native
Creating books app with react native
 

Viewers also liked

Introduction to NativeScript - BuildTruly Native Apps using JavaScript
Introduction to NativeScript - BuildTruly Native Apps using JavaScriptIntroduction to NativeScript - BuildTruly Native Apps using JavaScript
Introduction to NativeScript - BuildTruly Native Apps using JavaScript
Lohith Goudagere Nagaraj
 
Native Script by Sebastian Witalec
Native Script by Sebastian WitalecNative Script by Sebastian Witalec
Native Script by Sebastian Witalec
London Mobile Developers
 
Getting Started with Angular 2
Getting Started with Angular 2Getting Started with Angular 2
Getting Started with Angular 2
FITC
 
React lecture
React lectureReact lecture
React lecture
Christoffer Noring
 
Why discovery of open books is a challenge
Why discovery of open books is a challengeWhy discovery of open books is a challenge
Why discovery of open books is a challenge
Eelco Ferwerda
 
The sorry state of Finnish e-payment APIs
The sorry state of Finnish e-payment APIsThe sorry state of Finnish e-payment APIs
The sorry state of Finnish e-payment APIs
Juho Nurminen
 
Causal and semantic relatedness effects on L2 text processing and memory: Evi...
Causal and semantic relatedness effects on L2 text processing and memory: Evi...Causal and semantic relatedness effects on L2 text processing and memory: Evi...
Causal and semantic relatedness effects on L2 text processing and memory: Evi...
Shingo Nahatame
 
Research Brief: Federal Reserve // March 2017
Research Brief: Federal Reserve // March 2017Research Brief: Federal Reserve // March 2017
Research Brief: Federal Reserve // March 2017
Nicole Wesley-Smith
 
Comment automatiser l'exploitation de vos données webanalytics
Comment automatiser l'exploitation de vos données webanalyticsComment automatiser l'exploitation de vos données webanalytics
Comment automatiser l'exploitation de vos données webanalytics
uptilab
 
บทที่8กฎหมายคอมพิวเตอร์[1]
บทที่8กฎหมายคอมพิวเตอร์[1]บทที่8กฎหมายคอมพิวเตอร์[1]
บทที่8กฎหมายคอมพิวเตอร์[1]
ฟาอี คนเดินทางที่ไม่รู้จบ
 
Why It Takes 7-13+ Touches to Generate a Qualified B2B Sales Lead Today
Why It Takes 7-13+ Touches to Generate a Qualified B2B Sales Lead TodayWhy It Takes 7-13+ Touches to Generate a Qualified B2B Sales Lead Today
Why It Takes 7-13+ Touches to Generate a Qualified B2B Sales Lead TodayVivastream
 
Identifying your Target Audience: How to Define and Maximize It
Identifying your Target Audience: How to Define and Maximize ItIdentifying your Target Audience: How to Define and Maximize It
Identifying your Target Audience: How to Define and Maximize It
Matt Haag
 
Origen y evolucion del teatro
Origen y evolucion del teatroOrigen y evolucion del teatro
Origen y evolucion del teatro
Aristides Raul Olmedo Duarte
 
Ilb ira brochure-20140327145457
Ilb ira brochure-20140327145457Ilb ira brochure-20140327145457
Ilb ira brochure-20140327145457
Michael Kleven
 

Viewers also liked (15)

Introduction to NativeScript - BuildTruly Native Apps using JavaScript
Introduction to NativeScript - BuildTruly Native Apps using JavaScriptIntroduction to NativeScript - BuildTruly Native Apps using JavaScript
Introduction to NativeScript - BuildTruly Native Apps using JavaScript
 
Rxjs ppt
Rxjs pptRxjs ppt
Rxjs ppt
 
Native Script by Sebastian Witalec
Native Script by Sebastian WitalecNative Script by Sebastian Witalec
Native Script by Sebastian Witalec
 
Getting Started with Angular 2
Getting Started with Angular 2Getting Started with Angular 2
Getting Started with Angular 2
 
React lecture
React lectureReact lecture
React lecture
 
Why discovery of open books is a challenge
Why discovery of open books is a challengeWhy discovery of open books is a challenge
Why discovery of open books is a challenge
 
The sorry state of Finnish e-payment APIs
The sorry state of Finnish e-payment APIsThe sorry state of Finnish e-payment APIs
The sorry state of Finnish e-payment APIs
 
Causal and semantic relatedness effects on L2 text processing and memory: Evi...
Causal and semantic relatedness effects on L2 text processing and memory: Evi...Causal and semantic relatedness effects on L2 text processing and memory: Evi...
Causal and semantic relatedness effects on L2 text processing and memory: Evi...
 
Research Brief: Federal Reserve // March 2017
Research Brief: Federal Reserve // March 2017Research Brief: Federal Reserve // March 2017
Research Brief: Federal Reserve // March 2017
 
Comment automatiser l'exploitation de vos données webanalytics
Comment automatiser l'exploitation de vos données webanalyticsComment automatiser l'exploitation de vos données webanalytics
Comment automatiser l'exploitation de vos données webanalytics
 
บทที่8กฎหมายคอมพิวเตอร์[1]
บทที่8กฎหมายคอมพิวเตอร์[1]บทที่8กฎหมายคอมพิวเตอร์[1]
บทที่8กฎหมายคอมพิวเตอร์[1]
 
Why It Takes 7-13+ Touches to Generate a Qualified B2B Sales Lead Today
Why It Takes 7-13+ Touches to Generate a Qualified B2B Sales Lead TodayWhy It Takes 7-13+ Touches to Generate a Qualified B2B Sales Lead Today
Why It Takes 7-13+ Touches to Generate a Qualified B2B Sales Lead Today
 
Identifying your Target Audience: How to Define and Maximize It
Identifying your Target Audience: How to Define and Maximize ItIdentifying your Target Audience: How to Define and Maximize It
Identifying your Target Audience: How to Define and Maximize It
 
Origen y evolucion del teatro
Origen y evolucion del teatroOrigen y evolucion del teatro
Origen y evolucion del teatro
 
Ilb ira brochure-20140327145457
Ilb ira brochure-20140327145457Ilb ira brochure-20140327145457
Ilb ira brochure-20140327145457
 

Similar to Nativescript with angular 2

Ignite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and FirebaseIgnite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and Firebase
Jen Looper
 
Fastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS AppsFastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS Apps
Sarath C
 
Mobile development in 2020
Mobile development in 2020 Mobile development in 2020
Mobile development in 2020
Bogusz Jelinski
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code維佋 唐
 
Nodejs Intro - Part2 Introduction to Web Applications
Nodejs Intro - Part2 Introduction to Web ApplicationsNodejs Intro - Part2 Introduction to Web Applications
Nodejs Intro - Part2 Introduction to Web Applications
Budh Ram Gurung
 
Phonegap android angualr material design
Phonegap android angualr material designPhonegap android angualr material design
Phonegap android angualr material design
Srinadh Kanugala
 
React Native
React NativeReact Native
React Native
Craig Jolicoeur
 
The Happy Path: Migration Strategies for Node.js
The Happy Path: Migration Strategies for Node.jsThe Happy Path: Migration Strategies for Node.js
The Happy Path: Migration Strategies for Node.js
Nicholas Jansma
 
Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]
Sentinel Solutions Ltd
 
Kunal bhatia resume mass
Kunal bhatia   resume massKunal bhatia   resume mass
Kunal bhatia resume mass
Kunal Bhatia, MBA Candidate, BSc.
 
Visual Studio 2017 Launch Event
Visual Studio 2017 Launch EventVisual Studio 2017 Launch Event
Visual Studio 2017 Launch Event
James Montemagno
 
Expo - Zero to App.pptx
Expo - Zero to App.pptxExpo - Zero to App.pptx
Expo - Zero to App.pptx
😎 Anthony Kariuki
 
High Productivity Web Development Workflow
High Productivity Web Development WorkflowHigh Productivity Web Development Workflow
High Productivity Web Development Workflow
Vũ Nguyễn
 
High productivity web development workflow - JavaScript Meetup Saigon 2014
High productivity web development workflow - JavaScript Meetup Saigon 2014High productivity web development workflow - JavaScript Meetup Saigon 2014
High productivity web development workflow - JavaScript Meetup Saigon 2014
Oliver N
 
DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.
JooinK
 
DIY- computer vision with GWT
DIY- computer vision with GWTDIY- computer vision with GWT
DIY- computer vision with GWTFrancesca Tosi
 
Progressive Web Application by Citytech
Progressive Web Application by CitytechProgressive Web Application by Citytech
Progressive Web Application by Citytech
Ritwik Das
 
NativeScript 環境のインストールとはじめてのプロジェクト実行
NativeScript 環境のインストールとはじめてのプロジェクト実行NativeScript 環境のインストールとはじめてのプロジェクト実行
NativeScript 環境のインストールとはじめてのプロジェクト実行
Osamu Monoe
 
Cross Platform Mobile App Development
Cross Platform Mobile App DevelopmentCross Platform Mobile App Development
Cross Platform Mobile App Development
Annmarie Lanesey
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic Framework
Troy Miles
 

Similar to Nativescript with angular 2 (20)

Ignite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and FirebaseIgnite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and Firebase
 
Fastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS AppsFastlane - Automation and Continuous Delivery for iOS Apps
Fastlane - Automation and Continuous Delivery for iOS Apps
 
Mobile development in 2020
Mobile development in 2020 Mobile development in 2020
Mobile development in 2020
 
Parse cloud code
Parse cloud codeParse cloud code
Parse cloud code
 
Nodejs Intro - Part2 Introduction to Web Applications
Nodejs Intro - Part2 Introduction to Web ApplicationsNodejs Intro - Part2 Introduction to Web Applications
Nodejs Intro - Part2 Introduction to Web Applications
 
Phonegap android angualr material design
Phonegap android angualr material designPhonegap android angualr material design
Phonegap android angualr material design
 
React Native
React NativeReact Native
React Native
 
The Happy Path: Migration Strategies for Node.js
The Happy Path: Migration Strategies for Node.jsThe Happy Path: Migration Strategies for Node.js
The Happy Path: Migration Strategies for Node.js
 
Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]Titanium Studio [Updated - 18/12/2011]
Titanium Studio [Updated - 18/12/2011]
 
Kunal bhatia resume mass
Kunal bhatia   resume massKunal bhatia   resume mass
Kunal bhatia resume mass
 
Visual Studio 2017 Launch Event
Visual Studio 2017 Launch EventVisual Studio 2017 Launch Event
Visual Studio 2017 Launch Event
 
Expo - Zero to App.pptx
Expo - Zero to App.pptxExpo - Zero to App.pptx
Expo - Zero to App.pptx
 
High Productivity Web Development Workflow
High Productivity Web Development WorkflowHigh Productivity Web Development Workflow
High Productivity Web Development Workflow
 
High productivity web development workflow - JavaScript Meetup Saigon 2014
High productivity web development workflow - JavaScript Meetup Saigon 2014High productivity web development workflow - JavaScript Meetup Saigon 2014
High productivity web development workflow - JavaScript Meetup Saigon 2014
 
DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.DIY: Computer Vision with GWT.
DIY: Computer Vision with GWT.
 
DIY- computer vision with GWT
DIY- computer vision with GWTDIY- computer vision with GWT
DIY- computer vision with GWT
 
Progressive Web Application by Citytech
Progressive Web Application by CitytechProgressive Web Application by Citytech
Progressive Web Application by Citytech
 
NativeScript 環境のインストールとはじめてのプロジェクト実行
NativeScript 環境のインストールとはじめてのプロジェクト実行NativeScript 環境のインストールとはじめてのプロジェクト実行
NativeScript 環境のインストールとはじめてのプロジェクト実行
 
Cross Platform Mobile App Development
Cross Platform Mobile App DevelopmentCross Platform Mobile App Development
Cross Platform Mobile App Development
 
Cross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic FrameworkCross Platform Mobile Apps with the Ionic Framework
Cross Platform Mobile Apps with the Ionic Framework
 

More from Christoffer Noring

Azure signalR
Azure signalRAzure signalR
Azure signalR
Christoffer Noring
 
Game dev 101 part 3
Game dev 101 part 3Game dev 101 part 3
Game dev 101 part 3
Christoffer Noring
 
Game dev 101 part 2
Game dev 101   part 2Game dev 101   part 2
Game dev 101 part 2
Christoffer Noring
 
Game dev workshop
Game dev workshopGame dev workshop
Game dev workshop
Christoffer Noring
 
Deploying your static web app to the Cloud
Deploying your static web app to the CloudDeploying your static web app to the Cloud
Deploying your static web app to the Cloud
Christoffer Noring
 
IaaS with ARM templates for Azure
IaaS with ARM templates for AzureIaaS with ARM templates for Azure
IaaS with ARM templates for Azure
Christoffer Noring
 
Learning Svelte
Learning SvelteLearning Svelte
Learning Svelte
Christoffer Noring
 
Ng spain
Ng spainNg spain
Angular Schematics
Angular SchematicsAngular Schematics
Angular Schematics
Christoffer Noring
 
Design thinking
Design thinkingDesign thinking
Design thinking
Christoffer Noring
 
Keynote ijs
Keynote ijsKeynote ijs
Keynote ijs
Christoffer Noring
 
Vue fundamentasl with Testing and Vuex
Vue fundamentasl with Testing and VuexVue fundamentasl with Testing and Vuex
Vue fundamentasl with Testing and Vuex
Christoffer Noring
 
Ngrx slides
Ngrx slidesNgrx slides
Ngrx slides
Christoffer Noring
 
Kendoui
KendouiKendoui
Angular mix chrisnoring
Angular mix chrisnoringAngular mix chrisnoring
Angular mix chrisnoring
Christoffer Noring
 
Nativescript angular
Nativescript angularNativescript angular
Nativescript angular
Christoffer Noring
 
Graphql, REST and Apollo
Graphql, REST and ApolloGraphql, REST and Apollo
Graphql, REST and Apollo
Christoffer Noring
 
Angular 2 introduction
Angular 2 introductionAngular 2 introduction
Angular 2 introduction
Christoffer Noring
 
Rxjs vienna
Rxjs viennaRxjs vienna
Rxjs vienna
Christoffer Noring
 
Rxjs marble-testing
Rxjs marble-testingRxjs marble-testing
Rxjs marble-testing
Christoffer Noring
 

More from Christoffer Noring (20)

Azure signalR
Azure signalRAzure signalR
Azure signalR
 
Game dev 101 part 3
Game dev 101 part 3Game dev 101 part 3
Game dev 101 part 3
 
Game dev 101 part 2
Game dev 101   part 2Game dev 101   part 2
Game dev 101 part 2
 
Game dev workshop
Game dev workshopGame dev workshop
Game dev workshop
 
Deploying your static web app to the Cloud
Deploying your static web app to the CloudDeploying your static web app to the Cloud
Deploying your static web app to the Cloud
 
IaaS with ARM templates for Azure
IaaS with ARM templates for AzureIaaS with ARM templates for Azure
IaaS with ARM templates for Azure
 
Learning Svelte
Learning SvelteLearning Svelte
Learning Svelte
 
Ng spain
Ng spainNg spain
Ng spain
 
Angular Schematics
Angular SchematicsAngular Schematics
Angular Schematics
 
Design thinking
Design thinkingDesign thinking
Design thinking
 
Keynote ijs
Keynote ijsKeynote ijs
Keynote ijs
 
Vue fundamentasl with Testing and Vuex
Vue fundamentasl with Testing and VuexVue fundamentasl with Testing and Vuex
Vue fundamentasl with Testing and Vuex
 
Ngrx slides
Ngrx slidesNgrx slides
Ngrx slides
 
Kendoui
KendouiKendoui
Kendoui
 
Angular mix chrisnoring
Angular mix chrisnoringAngular mix chrisnoring
Angular mix chrisnoring
 
Nativescript angular
Nativescript angularNativescript angular
Nativescript angular
 
Graphql, REST and Apollo
Graphql, REST and ApolloGraphql, REST and Apollo
Graphql, REST and Apollo
 
Angular 2 introduction
Angular 2 introductionAngular 2 introduction
Angular 2 introduction
 
Rxjs vienna
Rxjs viennaRxjs vienna
Rxjs vienna
 
Rxjs marble-testing
Rxjs marble-testingRxjs marble-testing
Rxjs marble-testing
 

Recently uploaded

To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 

Recently uploaded (20)

To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 

Nativescript with angular 2

  • 1. Nativescript for Angular2 Chris Noring Google Developer Expert Front end Developer at OVO Energy
  • 3. What’s out there for building apps?
  • 4. App store and market place = plan for monetizing + It also has Built in features like camera, gps, push notifications + Has access to Native swift, objective-c java - Usually needs one dev team per platform $$$
  • 5. Web apps One team, only needs to know javascript + css + Cost less - Limited access to hardware - Browser support, increase maintenance and dev time - Monetizing? Will cost time and money to make it work well on all browsers also conti - Doesn’t feel like native, its a compromise + Great for simple scenarios like a responsive version of t geoposition
  • 6. Hybrid frameworks - You need to learn its api rendering in web views, not truly native UI + It is possible to use an App Store - Limited access to hardware but the support is getting better and better WebRTC* WebGL WebAudio IndexedDB Web Components* Utilize Hardware Acceleratio Remote Debugging* - More and more cool features are being supported just a regular mobile optimized website, written in CSS, HTML and JavaScript, that is display Ionic Cordova Phonegap Titanium React Native
  • 7. Progressive web apps + Caches Is this the future? - Monetizing? + Feels like an app - Not great support on Safari yet + Progressive enhancement better features with better browser and better broadband + Push notifications
  • 8. So how does nativescript fit in?
  • 9. It’s NOT web although javascript, so no DOM It targets actual apis Its supports hardware due to being actual native BUT you can use your javascript and css skills AND you can use your native developers because THEY KNOW THE API It’s NOT either javascript or native folks, ITS BOTH
  • 10. Nativescript killer features You can style native ui with css You can use javascript OR angular 2 with typescript free and open source framework for building native iOS and Android apps using JavaScript and C You can access native apis with javascript it’s free It has hardware accelerated animations You can monetise cause you can use App Store and markets It’s pluggable, you can use and write your own plugins
  • 11. How does it work?
  • 12. Nativescript runtime uses Javascript virtual machines executed by V8. is JIT compiled and v8 JavaScriptCore Android iOS how does v8 know what android.text.format.Time() is? var time = new android.text.format.Time(); this is javascript
  • 13. NativeScript uses it to inject APIs that let you access native code. nativescript inject android/ios object to v8 or Javascript Core There are APIs on v8 that lets you affect the global scope How to know what to inject? JavaScriptCore has a similar mechanism that makes the same te How to interpret the js code?
  • 14. 1) NativeScript uses reflection to build the list of the APIs that are av invokes a callback that native script can intercept, in that interceptio 2) android.text.format.Time() javascript code corresponding c++ callback invokes JNI-bridge to talk to native API Android invokes native API directly iOS
  • 15. In conclusion Nativescript investigates what to inject and injects metadat A callback is connected to each executed javascript that na C++ code on Android targets JNI ( c++ becomes java ) that C++ on iOS talks to native API directly And presto
  • 17. Modules camera.android.js camera.ios.js camera-common.js selects the correct one at runtime require(‘camera’) camera node_modules/ tns-core-modules module module camera … usage everything is made up of modules
  • 18. How easy is it to get started?
  • 19. Preparing your environment npm install nativescript -g Windows ecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https Mac ruby -e "$(curl -fsSL https://www.nativescript.org/setup/mac)" tns doctor verify your installation
  • 20. Continued.. For android install genymotion https://www.genymotion.com/ set path to android SDK
  • 21. First app scaffold or tns create my-app-name --ng creates angular2 app git clone https://github.com/NativeScript/sample-Groceries.git angular 2 app for nativescript Scaffolding saves a lot of time
  • 22. What is the dev experience like?
  • 23. We got a plugin for vs code so we can set break points We can use hot reload, so code is recompiled and rede We can write and run unit tests
  • 24. Hot reload tns livesync platform —watch 1) compiles app 2) deploys to emulator/ device repeats 1) + 2) on changes
  • 25. Debug tns debug platform starts platform specific debugger with option —debug-brk —debug-brk —start —stop —emulator
  • 26. set breakpoint perform action Build and start the application Start Node Inspector Launch Chrome browser tns debug platform
  • 27. Remote chromium debugger for Eclipse https://www.nativescript.org/nativescript-for-visual-studio-code Plugin for vs code ext install nativescript
  • 28. How hard is it to accomplish something?
  • 29. So we can be productive with all these components we code in angular 2 we can easily extend with plugins we can write our own plugins we got, ui components, we got layouts,http, css animations, gestures, hardware and more..
  • 30. Controls with ng2 <Label class="lbl" [text]="title"></Label> <Button (tap)="click()" text="Save new hero"></Button> <TextField [(ngModel)]="status"></TextField> <ListView [items]="todos" (itemTap)="tapped($event)" > <template let-item="item" let-odd="odd" let-even="even"> </template> </ListView> one-way binding event binding two-way binding So angular 2 with some new components
  • 32. Whats possible? Create, Read, Update, Delete on files and folders import * as fs from "file-system"; var documents = fs.knownFolders.documents(); var myFile = documents.getFile("Test_Write.txt"); myFile.writeText("Something") .then(function () { }, err {}); myFile.readText() .then(function (content) { }, err {}); do something with retrieved content
  • 35. AbsoluteLayout DockLayout GridLayout StackLayout WrapLayout Components ends up exactly where you want them x,y Arranges children to outer edges, last child takes up remaining space columns and rows Horizontally or vertically follows orientation til space is filled then wraps them into new column/row
  • 37. Navigation Navigation is angular 2 router if you know how that works then you know how to build the app
  • 38. CSS
  • 39. CSS Application-wide css, app.css Component-specific css @Component({ styleUrls : [‘pages/examples/list- demo.component.css'] }) @Component({ style : ‘’ }) https://docs.nativescript.org/angular/ui/styling.html Inline css <Button text="inline style" style="background-color: green;"></Button> <Button backgroundColor=“lightgray" >
  • 41. What is a native script plugin? plugin file.android.ts file.ios.ts package.json lookup iOS and java implementation of the same thing [NSDate date] new Date()).toString() and add to respective file.platform.ts write js-ified code corresponding to native api NsDate.date() (new java.util.Date()).toString() Is an npm package, published or not, that exposes a native API
  • 42. http://developer.telerik.com/featured/creating-nativescript-plugins-in-types Great article to get started http://plugins.telerik.com/nativescript Telerik verified marketplace https://docs.nativescript.org/plugins/plugins More details tns plugin add <Plugin> tns plugin remove <Plugin> Add/Remove https://www.thepolyglotdeveloper.com/2016/07/create-native-ios-and-andr
  • 44. Camera import * as cameraModule from 'camera'; cameraModule.takePicture({ width: 300, height: 300, keepAspectRatio: true }) .then((picture) => { console.log('picture taken'); this.source = picture; }) <Image [src]="source" stretch="none" horizontalAlignment="center" > </Image> take picture import a reference Display image in control
  • 46. A word about images file system <Image src="~/images/logo.png" stretch ="none" /> relative to the app folder url <Image src="https://www.google.com/images/errors/logo_sm_2.png" /> resource <Image src="res://logo" stretch ="none" /> App_Resources Android iOS Should be placed in resp platform
  • 48. tns plugin add nativescript-geolocation Install the plugin Check if its enabled, then ask for permission import * as geolocation from "nativescript-geolocation"; if (!geolocation.isEnabled()) { geolocation.enableLocationRequest(); } So much for enabling, how to use?
  • 49. geolocation.getCurrentLocation({ desiredAccuracy: 3, updateDistance: 10, maximumAge: 20000, timeout: 20000}) .then(function(loc) { if (loc) { alert("Current location is: " + loc); console.log("Current location is: " + loc); } }, function(e){ console.log("Error: " + e.message); }); get location, returns a promise And just use a plugin to show the location tns plugin add nativescript-google-sdk Use an actual device to test this one Once enabled, ask for location
  • 51. ctrl.animate({ opacity: 0, backgroundColor: new Color("Blue"), translate: { x: 200, y: 0 }, scale: { x: 2, y: 2 }, rotate: 180, duration: 800, delay: 20, iterations: 1, curve: enums.AnimationCurve.easeIn }) .then(() => { console.log('animation done'); this.ypos += 20; }) We can Rotate, scale, change opacity .. What can we do? translate rotate repeat animation when done
  • 53. Nativescript let’s you code an actual native app using the API you know using javascript Just remember this..
  • 54. Thank you for listening