SlideShare une entreprise Scribd logo
1  sur  37
Everything about NativeScript
Agenda
• Overview of Native Script
• Pre-Requisites for Native Script
• Native Script App Folders
• Basic Commands of Native Script
• Native Script Controls
• Demo LiveSync and HMR
• Demo using Native Script –Play Ground
• Demo using Visual Studio Code
My Intro
• Baskar Rao
• Senior .Net Consultant with Compunnel Software Group.
• @baskarmib
• https://www.linkedin.com/in/baskarrao-dandlamudi
• baskarrao.dandlamudi@outlook.com
• www.compunnel.com
• https://github.com/baskar3078/NativeScriptSamples
Native Script - Overview
• Native Script is free open source framework
for building native IOS and Android Apps.
• Build Cross Platform mobile apps using single
code base.
• Develop Mobile Apps using JavaScript ,
Angular , Typescript and Vue
Why Native Script
• Web Developers with knowledge of HTML,
CSS and JavaScript can use the same to
develop rich native mobile applications.
• Easily develop apps using existing plugins
from npm [Node], Gradle [Android] and IOS
Plugins.
• Easy to learn and develop apps using pre-
defined templates.
Pre-Requisites of Native Script
• Prior Knowledge of HTML, CSS and any one
of scripting language JavaScript , Angular,
Typescript or Vue
• Node.js Server, Command Line Terminal and
Preferred Text IDE Editor
• Android Studio, Android SDK and Android
Emulator, Java SDK
Native Script – App Structure
Native Script App Structure
• Any Native Script app contains the below
folders
• Root – Project Name
• App Folder
• Node_Modules
• Package.Json
• Platforms
App Structure
• App Folder
This folder contains all the development resources like forms, js files
• Node_Modules
This folder contains application npm module dependencies. The tns-core modules folder contains Native
Script related javascript modules which can be used to develop features in the application like http calls,
access files etc.
• Package.Json
Details of application and the version of native script used and other npm modules used in the application.
• Platforms
This folder contains platform-specific code which Native Script needs to build IOS or Android Apps.
This is mostly generated code by Native Script CLI.
App Structure - Contd
• App_Resources
This folder contains platform specific resources.
• Shared
This folder contains files that needs to be shared across views
In app.
• Views
This folder contains the code to build apps views. Each view is made
Up of XML File, a Javascript file and optional css file.
• App.css
File contains global styles used in the app.
• App.Js
This file sets up applications starting module and initializes the app.
Native Script CLI Basic Commands
• tns create appname --template template name
• This creates an app based on the provided template name.
• Hello world template is used when no template flag is provided
• tns platform add android
• This creates the android specific platform folder.
• tns platform add ios
• This creates the IOS specific platform folder.
Native Script CLI Basic Commands
• tns build android
• This command converts code from app folder to android platform.
• tns build ios
• This command converts code from app folder to ios platform
• tns run android --emulator
• This command builds and runs the app in android emulator
• tns run ios
• This command builds and runs the app in IOS device or emulator
IOS specific commands cannot be executed in Windows OS.
Native Script CLI Basic Commands
• tns plugin add “pluginname or path to pluginname”
• This command is used to add nativescript plugin to application.
• tns prepare android
• This command is used to update android platform folder with changes from app folder.
• tns prepare ios
• This command is used to update IOS platform folder with changes from app folder
• tns doctor
• This command is used to verify if all required components are setup in development machine.
Native Script CLI Basic Commands
• tns test init
• This command is used to initialize testing folder.
• tns test platform
• This command is used to run tests against the selected platform.
• tns debug platform
• This command is used to debug Nativescript apps using chrome dev
tools
Native Script Controls
What makes a Native Script View
• Native Script View is comprised of three files.
-- ViewName.xml
-- ViewName.css
-- ViewName.js
• Xml file is used to design the screen layout and screen controls.
• Css file is used to mention css class specific to the view.
• Js file acts as the code behind file similar to aspx.cs for an aspx page.
Native Script View Models
• Native Script View Models are used to enable two way data flow between model and view
• Native Script uses the observable module to facilitate the binding between view and model
var observableModule = require("data/observable");
• The properties defined in view model can be accessed in view using the “{{ propertyname }}” syntax
<TextField id="email" text="{{ email }}" keyboardType="email" autocorrect="false" autocapitalizationType="none" />
Native Script Basic Controls
HTML Control Native Script Control
<div> LayOut – Stack Layout, Grid LayOut, Wrap
LayOut, FlexBox Layout, Dock Layout
<input type="button" value=“Sign In"
onclick=“signIn()">
<Button text=“Sign In" tap="signIn"/>
<label>Click me </label> <Label text="{{ name }}" />
<img src="mdn-logo-sm.png" alt="MDN"> <Image src="res://logo" ></Image>
<input id="email" type="email"> <TextField id="email" text="{{ email }}"
keyboardType="email" autocorrect="false“
autocapitalizationType="none" />
Native Script Basic Controls
Image
<!-- Load image from app/App_Resources/<platform> folders-->
<Image src="res://logo_white_bg" stretch="none" class="img-rounded p-l-15 p-r-15 p-t-
15"></Image>
<!-- Load image from app/images folder -->
<Image src="~/images/logo.png" stretch="none" class="img-rounded p-l-15 p-r-15 p-t-
15"></Image>
<!-- Load image from url -->
<Image src="https://docs.nativescript.org/img/NativeScript_logo.png" stretch="none"
class="img-rounded p-l-15 p-r-15 p-t-15"></Image>
Native Script Basic Controls
Stack Layout
<StackLayout class="layoutBackgroundImageFromFolder">
<Button text="About" tap="loadAbout" />
<Button text="Schedule" tap="loadSchedule"/>
</StackLayout>
Stack Layout can be used to stack the controls vertical or horizontal similar to <div>.
You guys are Awesome!!!
https://speakerdeck.com/reverentgeek
Native Script Vue Basics
• Installation Requirements
• Node Js.
• Vue CLI
• NativeScript Vue CLI
• Vue Dev Tools
• Vuex for State Management
• No Support for Vue Router
• No Support for Vue Testing – Can use Appium to test.
Native Script Vue Basics
• Single Page Components
• Native Script supports Single Page Components of Vue.
• Component Structure
• template.
• script section
• style section
Native Script Vue Basics
Native Script Vue Basics
Native Script Vue Basics
Native Script Vue Basics
Dev Tools
• Visual Studio Code
Install NativeScript PlugIn
Create a native script app using tns create app command.
Navigate to the app folder.
Enter code . Command .
• Chrome Developer Tools
Chrome Developer Tools can also be used to
debug NativeScript Applications.
Dev Tools
• Native Script Play Ground
Native Script Play Ground is a browser based platform to develop and preview mobile applications
Dev Tools
• Native Script Side Kick
Can be used to develop applications with pre-defined starter templates
Perform cloud or local builds and deploy to test devices
Helps to develop IOS Applications on Windows O/S
Walkthrough
• Demo of an existing app using Play Ground
• Demo live sync feature
• Demo HMR using Visual Studio Code
NativeScript UpLabs Challenge
Native Script Contributions
Interested in Exploring Vue
• Check out the session by Lee Brandt at 2 PM in Main Auditorium.
• https://twitter.com/leebrandt
•A Developers Guide to Docker
Interested to Explore Docker
Further Resources
• Native Script - Documentation
• Native Script eBook is free book by @brosteins available for download
• Native Script Blog
• Native Script Code Snippets
• Native Script Playground - Browser based development tool
• Native Script Sidekick – Useful for developing IOS apps on Windows Machine
• Native Script Vue Documentation
Questions
https://www.linkedin.com/in/baskarrao-dandlamudi
baskarrao.dandlamudi@outlook.com
https://baskarrao.wordpress.com/
Thanks to Columbus Code Camp Team for opportunity. Please share your feedback at
https://docs.google.com/forms/d/11fwzfz7nqFnBm1LFZpYlZmMq0dO6HXDl3yzhU0egIDU

Contenu connexe

Tendances

Development of automated tests for ext js based web sites
Development of automated tests for ext js based web sitesDevelopment of automated tests for ext js based web sites
Development of automated tests for ext js based web sites
ISsoft
 
Spec et test agile sur mobile @airfrance #at lille & cocoaheads tls
Spec et test agile sur mobile @airfrance #at lille & cocoaheads tlsSpec et test agile sur mobile @airfrance #at lille & cocoaheads tls
Spec et test agile sur mobile @airfrance #at lille & cocoaheads tls
ekito
 

Tendances (20)

Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
Hybrid Mobile Development with Apache Cordova and Java EE 7 (JavaOne 2014)
 
Building an Ionic hybrid mobile app with TypeScript
Building an Ionic hybrid mobile app with TypeScript Building an Ionic hybrid mobile app with TypeScript
Building an Ionic hybrid mobile app with TypeScript
 
Cordova: APIs and instruments
Cordova: APIs and instrumentsCordova: APIs and instruments
Cordova: APIs and instruments
 
React Native
React NativeReact Native
React Native
 
React Native - Why Designers should use React native. And everyone else too.
React Native - Why Designers should use React native. And everyone else too.React Native - Why Designers should use React native. And everyone else too.
React Native - Why Designers should use React native. And everyone else too.
 
Development of automated tests for ext js based web sites
Development of automated tests for ext js based web sitesDevelopment of automated tests for ext js based web sites
Development of automated tests for ext js based web sites
 
Don Wibier
Don WibierDon Wibier
Don Wibier
 
Spec et test agile sur mobile @airfrance #at lille & cocoaheads tls
Spec et test agile sur mobile @airfrance #at lille & cocoaheads tlsSpec et test agile sur mobile @airfrance #at lille & cocoaheads tls
Spec et test agile sur mobile @airfrance #at lille & cocoaheads tls
 
Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)Introduction to Apache Cordova (Phonegap)
Introduction to Apache Cordova (Phonegap)
 
Testing Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS CurriculumTesting Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS Curriculum
 
Cross-Platform Development
Cross-Platform DevelopmentCross-Platform Development
Cross-Platform Development
 
Building a mobile application for dot netnuke
Building a mobile application for dot netnukeBuilding a mobile application for dot netnuke
Building a mobile application for dot netnuke
 
Deploying ASP.Net Core apps in Docker Containers
Deploying ASP.Net Core apps in Docker ContainersDeploying ASP.Net Core apps in Docker Containers
Deploying ASP.Net Core apps in Docker Containers
 
ASP.NET Core 1.0 Overview
ASP.NET Core 1.0 OverviewASP.NET Core 1.0 Overview
ASP.NET Core 1.0 Overview
 
Getting started with titanium
Getting started with titaniumGetting started with titanium
Getting started with titanium
 
A walkthrough of JavaScript ES6 features
A walkthrough of JavaScript ES6 featuresA walkthrough of JavaScript ES6 features
A walkthrough of JavaScript ES6 features
 
Introduction to React Native & Redux
Introduction to React Native & ReduxIntroduction to React Native & Redux
Introduction to React Native & Redux
 
Mobile App Development Using Appcelerator and DNN WebAPIs
Mobile App Development Using Appcelerator and DNN WebAPIsMobile App Development Using Appcelerator and DNN WebAPIs
Mobile App Development Using Appcelerator and DNN WebAPIs
 
Docker for .net developer
Docker for .net developerDocker for .net developer
Docker for .net developer
 
Xamarin forms introduction by Taswar Bhatti and Ahmed Assad
Xamarin forms introduction by Taswar Bhatti and Ahmed AssadXamarin forms introduction by Taswar Bhatti and Ahmed Assad
Xamarin forms introduction by Taswar Bhatti and Ahmed Assad
 

Similaire à Native script overview

Build your android app with gradle
Build your android app with gradleBuild your android app with gradle
Build your android app with gradle
Swain Loda
 
Web dev tools review
Web dev tools reviewWeb dev tools review
Web dev tools review
Changhyun Lee
 

Similaire à Native script overview (20)

Native script overview
Native script overviewNative script overview
Native script overview
 
Building your first android app using Xamarin
Building your first android app using XamarinBuilding your first android app using Xamarin
Building your first android app using Xamarin
 
Building your first android app using xamarin (Gill Cleeren)
Building your first android app using xamarin (Gill Cleeren)Building your first android app using xamarin (Gill Cleeren)
Building your first android app using xamarin (Gill Cleeren)
 
Angular mobile angular_u
Angular mobile angular_uAngular mobile angular_u
Angular mobile angular_u
 
NativeScript 環境のインストールとはじめてのプロジェクト実行
NativeScript 環境のインストールとはじめてのプロジェクト実行NativeScript 環境のインストールとはじめてのプロジェクト実行
NativeScript 環境のインストールとはじめてのプロジェクト実行
 
Getting started with Appcelerator Titanium
Getting started with Appcelerator TitaniumGetting started with Appcelerator Titanium
Getting started with Appcelerator Titanium
 
Android - Anroid Pproject
Android - Anroid PprojectAndroid - Anroid Pproject
Android - Anroid Pproject
 
Xamarin.Forms Bootcamp
Xamarin.Forms BootcampXamarin.Forms Bootcamp
Xamarin.Forms Bootcamp
 
iOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for BeginnersiOS Application Penetration Testing for Beginners
iOS Application Penetration Testing for Beginners
 
Develop business apps cross-platform development using visual studio with x...
Develop business apps   cross-platform development using visual studio with x...Develop business apps   cross-platform development using visual studio with x...
Develop business apps cross-platform development using visual studio with x...
 
Reactive summit 2020 microsoft orleans the easy way
Reactive summit 2020   microsoft orleans the easy wayReactive summit 2020   microsoft orleans the easy way
Reactive summit 2020 microsoft orleans the easy way
 
Diagnosing issues in your ASP.NET applications in production with Visual Stud...
Diagnosing issues in your ASP.NET applications in production with Visual Stud...Diagnosing issues in your ASP.NET applications in production with Visual Stud...
Diagnosing issues in your ASP.NET applications in production with Visual Stud...
 
React nativebeginner1
React nativebeginner1React nativebeginner1
React nativebeginner1
 
Nativescript
NativescriptNativescript
Nativescript
 
Apache Cordova 4.x
Apache Cordova 4.xApache Cordova 4.x
Apache Cordova 4.x
 
Build your android app with gradle
Build your android app with gradleBuild your android app with gradle
Build your android app with gradle
 
Introduction phonegap
Introduction phonegapIntroduction phonegap
Introduction phonegap
 
Advanced programing in phonegap
Advanced programing in phonegapAdvanced programing in phonegap
Advanced programing in phonegap
 
Web dev tools review
Web dev tools reviewWeb dev tools review
Web dev tools review
 
[2015/2016] Apache Cordova
[2015/2016] Apache Cordova[2015/2016] Apache Cordova
[2015/2016] Apache Cordova
 

Plus de Baskar rao Dsn (8)

Play with azure functions
Play with azure functionsPlay with azure functions
Play with azure functions
 
Azure Functions in Action #CodePaLOUsa
Azure Functions in Action #CodePaLOUsaAzure Functions in Action #CodePaLOUsa
Azure Functions in Action #CodePaLOUsa
 
Azure Functions in Action #OrlandoCC
Azure Functions in Action #OrlandoCCAzure Functions in Action #OrlandoCC
Azure Functions in Action #OrlandoCC
 
Era of server less computing
Era of server less computingEra of server less computing
Era of server less computing
 
Era of server less computing final
Era of server less computing finalEra of server less computing final
Era of server less computing final
 
Steps to publish an application to azure service fabric
Steps to publish an application to azure service fabricSteps to publish an application to azure service fabric
Steps to publish an application to azure service fabric
 
Azure service fabric overview
Azure service fabric overviewAzure service fabric overview
Azure service fabric overview
 
Certificate
CertificateCertificate
Certificate
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Native script overview

  • 2. Agenda • Overview of Native Script • Pre-Requisites for Native Script • Native Script App Folders • Basic Commands of Native Script • Native Script Controls • Demo LiveSync and HMR • Demo using Native Script –Play Ground • Demo using Visual Studio Code
  • 3. My Intro • Baskar Rao • Senior .Net Consultant with Compunnel Software Group. • @baskarmib • https://www.linkedin.com/in/baskarrao-dandlamudi • baskarrao.dandlamudi@outlook.com • www.compunnel.com • https://github.com/baskar3078/NativeScriptSamples
  • 4. Native Script - Overview • Native Script is free open source framework for building native IOS and Android Apps. • Build Cross Platform mobile apps using single code base. • Develop Mobile Apps using JavaScript , Angular , Typescript and Vue
  • 5. Why Native Script • Web Developers with knowledge of HTML, CSS and JavaScript can use the same to develop rich native mobile applications. • Easily develop apps using existing plugins from npm [Node], Gradle [Android] and IOS Plugins. • Easy to learn and develop apps using pre- defined templates.
  • 6. Pre-Requisites of Native Script • Prior Knowledge of HTML, CSS and any one of scripting language JavaScript , Angular, Typescript or Vue • Node.js Server, Command Line Terminal and Preferred Text IDE Editor • Android Studio, Android SDK and Android Emulator, Java SDK
  • 7. Native Script – App Structure
  • 8. Native Script App Structure • Any Native Script app contains the below folders • Root – Project Name • App Folder • Node_Modules • Package.Json • Platforms
  • 9. App Structure • App Folder This folder contains all the development resources like forms, js files • Node_Modules This folder contains application npm module dependencies. The tns-core modules folder contains Native Script related javascript modules which can be used to develop features in the application like http calls, access files etc. • Package.Json Details of application and the version of native script used and other npm modules used in the application. • Platforms This folder contains platform-specific code which Native Script needs to build IOS or Android Apps. This is mostly generated code by Native Script CLI.
  • 10. App Structure - Contd • App_Resources This folder contains platform specific resources. • Shared This folder contains files that needs to be shared across views In app. • Views This folder contains the code to build apps views. Each view is made Up of XML File, a Javascript file and optional css file. • App.css File contains global styles used in the app. • App.Js This file sets up applications starting module and initializes the app.
  • 11. Native Script CLI Basic Commands • tns create appname --template template name • This creates an app based on the provided template name. • Hello world template is used when no template flag is provided • tns platform add android • This creates the android specific platform folder. • tns platform add ios • This creates the IOS specific platform folder.
  • 12. Native Script CLI Basic Commands • tns build android • This command converts code from app folder to android platform. • tns build ios • This command converts code from app folder to ios platform • tns run android --emulator • This command builds and runs the app in android emulator • tns run ios • This command builds and runs the app in IOS device or emulator IOS specific commands cannot be executed in Windows OS.
  • 13. Native Script CLI Basic Commands • tns plugin add “pluginname or path to pluginname” • This command is used to add nativescript plugin to application. • tns prepare android • This command is used to update android platform folder with changes from app folder. • tns prepare ios • This command is used to update IOS platform folder with changes from app folder • tns doctor • This command is used to verify if all required components are setup in development machine.
  • 14. Native Script CLI Basic Commands • tns test init • This command is used to initialize testing folder. • tns test platform • This command is used to run tests against the selected platform. • tns debug platform • This command is used to debug Nativescript apps using chrome dev tools
  • 16. What makes a Native Script View • Native Script View is comprised of three files. -- ViewName.xml -- ViewName.css -- ViewName.js • Xml file is used to design the screen layout and screen controls. • Css file is used to mention css class specific to the view. • Js file acts as the code behind file similar to aspx.cs for an aspx page.
  • 17. Native Script View Models • Native Script View Models are used to enable two way data flow between model and view • Native Script uses the observable module to facilitate the binding between view and model var observableModule = require("data/observable"); • The properties defined in view model can be accessed in view using the “{{ propertyname }}” syntax <TextField id="email" text="{{ email }}" keyboardType="email" autocorrect="false" autocapitalizationType="none" />
  • 18. Native Script Basic Controls HTML Control Native Script Control <div> LayOut – Stack Layout, Grid LayOut, Wrap LayOut, FlexBox Layout, Dock Layout <input type="button" value=“Sign In" onclick=“signIn()"> <Button text=“Sign In" tap="signIn"/> <label>Click me </label> <Label text="{{ name }}" /> <img src="mdn-logo-sm.png" alt="MDN"> <Image src="res://logo" ></Image> <input id="email" type="email"> <TextField id="email" text="{{ email }}" keyboardType="email" autocorrect="false“ autocapitalizationType="none" />
  • 19. Native Script Basic Controls Image <!-- Load image from app/App_Resources/<platform> folders--> <Image src="res://logo_white_bg" stretch="none" class="img-rounded p-l-15 p-r-15 p-t- 15"></Image> <!-- Load image from app/images folder --> <Image src="~/images/logo.png" stretch="none" class="img-rounded p-l-15 p-r-15 p-t- 15"></Image> <!-- Load image from url --> <Image src="https://docs.nativescript.org/img/NativeScript_logo.png" stretch="none" class="img-rounded p-l-15 p-r-15 p-t-15"></Image>
  • 20. Native Script Basic Controls Stack Layout <StackLayout class="layoutBackgroundImageFromFolder"> <Button text="About" tap="loadAbout" /> <Button text="Schedule" tap="loadSchedule"/> </StackLayout> Stack Layout can be used to stack the controls vertical or horizontal similar to <div>.
  • 21. You guys are Awesome!!! https://speakerdeck.com/reverentgeek
  • 22. Native Script Vue Basics • Installation Requirements • Node Js. • Vue CLI • NativeScript Vue CLI • Vue Dev Tools • Vuex for State Management • No Support for Vue Router • No Support for Vue Testing – Can use Appium to test.
  • 23. Native Script Vue Basics • Single Page Components • Native Script supports Single Page Components of Vue. • Component Structure • template. • script section • style section
  • 28. Dev Tools • Visual Studio Code Install NativeScript PlugIn Create a native script app using tns create app command. Navigate to the app folder. Enter code . Command . • Chrome Developer Tools Chrome Developer Tools can also be used to debug NativeScript Applications.
  • 29. Dev Tools • Native Script Play Ground Native Script Play Ground is a browser based platform to develop and preview mobile applications
  • 30. Dev Tools • Native Script Side Kick Can be used to develop applications with pre-defined starter templates Perform cloud or local builds and deploy to test devices Helps to develop IOS Applications on Windows O/S
  • 31. Walkthrough • Demo of an existing app using Play Ground • Demo live sync feature • Demo HMR using Visual Studio Code
  • 35. • Check out the session by Lee Brandt at 2 PM in Main Auditorium. • https://twitter.com/leebrandt •A Developers Guide to Docker Interested to Explore Docker
  • 36. Further Resources • Native Script - Documentation • Native Script eBook is free book by @brosteins available for download • Native Script Blog • Native Script Code Snippets • Native Script Playground - Browser based development tool • Native Script Sidekick – Useful for developing IOS apps on Windows Machine • Native Script Vue Documentation
  • 37. Questions https://www.linkedin.com/in/baskarrao-dandlamudi baskarrao.dandlamudi@outlook.com https://baskarrao.wordpress.com/ Thanks to Columbus Code Camp Team for opportunity. Please share your feedback at https://docs.google.com/forms/d/11fwzfz7nqFnBm1LFZpYlZmMq0dO6HXDl3yzhU0egIDU