SlideShare a Scribd company logo
NativeScript Best Coding Practices
A free and open source framework for building
truly native mobile apps with JavaScript. Use
web skills, like TypeScript, Angular, Vue and
CSS, and get native UI and performance on iOS
and Android.
NativeScript is…
5 Reasons to use NativeScript
• 1) Rich, animated native UI
• 2) Maximum code and skill reusability
• 3) Ease of doing native-y things
• 4) Vibrant and growing community
• 5) Supported by a major software company
Maximum
code and skill
reusability 🌮
2
or or
Architecture Choices 🔧
NativeScript modules for UIs
Reuse existing native Android and iOS libraries
NativeScript community forum
(forum.nativescript.org)
NativeScript community Slack channel
How we can improve the performance of the NS Apps
Architecting your application
correctly can have a
significant impact on
navigation time, on-page
render performance and
application maintenance
Web Mentality in Native Applications Does Not Work
Code For a Showing a simple dropdown with date and Alphabet
<StackLayout borderColor="#D6D6E4" borderWidth="1"
borderRadius="5" backgroundColor="white">
<StackLayout orientation="horizontal">
<Label class="accent" text="Date"></Label>
<!-- Custom Icon Directive -->
<Label horizontalAlignment="right" icon=“sort"></Label>
</StackLayout>
<StackLayout orientation="horizontal"
<Label text="Alphabetical"></Label>
</StackLayout>
</StackLayout>
When this code renders natively you create 3 view containers.Assume you
follow this mentality for the navigation, the card design, the search bar and every
other micro component in your application…. You start to end up with huge
rendering burden for your native application.
NativeScript is Single Threaded
• All the UI and interactions are ran on the main UI thread
• This means you are taxing your application for each container it has to render. The
number of containers also affect the performance of the underlying native frameworks
and their rendering and layout times
NativeScript does allow you to use background workers, but these are not meant for UI
and are instead used for services such as http calls, large data manipulations, etc.
Before Optimizations
<GridLayout>
<StackLayout>
<dropdown></dropdown>
</StackLayout>
</GridLayout>
After Optimizations
<GridLayout>
<StackLayout borderWidth=”1” borderColor=”#D6D6E4”
dropdown></StackLayout>
</GridLayout>
UI OPTIMIZATION TECHNIQUES
1. Avoid nested layouts
2. Use the least possible UI elements to build a
component
3. Avoid inline styles as much as possible
4. Try to reuse the most of NativeScript Theme
5. Use only lowercase and dashes for selectors
6. Prefer HEX over RGB color codes
7. Define global / local SCSS variables as
needed
Angular Optimisation Techniques
• Webpack, AOT and Uglify
Application will bootstrap faster - eliminating a lot of the “white screen” effects you may be
experiencing and the size of the application will be reduced.
• Lazy Loaded Modules
By breaking up your modules, they will be built into separate “chunks”. This means your
application will only request that chunk when it actually needs it. This avoids a lot of overhead
with fetching more information than your application needs per view.
• Wrapping Complex Views
By delaying the rendering of complex views, it allows your navigation event to complete soon
on the main thread, giving your user the illusion that the app isn’t lagging
• Reduce View Complexity
Some designs just do not make sense for a native application, especially a NativeScript application.
NativeScript is prestigious for its ability to access native APIs - not rendering complex UI
• Use Local Database
Using database like couch db or sqlite for storing data instead of saving it in cache for large applications
Thanks!
Suralal.S
Sr. Software Developer, Neoito

More Related Content

What's hot (20)

PPTX
Delivering Rich Content Applications at Scale with Nuxeo & MongoDB Atlas
Nuxeo
 
PPTX
Web App Security
Shahed Chowdhuri
 
PDF
Modern web technologies
Oday Alqarra
 
PPTX
Goldark Presentation at Qualcomm QPrize 2014
Leonardo Rossetti
 
PPTX
Prototyping Mobile Apps with NativeScript and Angular
Mike Branstein
 
PPTX
How to Win #BestMicrosoftHack with Azure
Shahed Chowdhuri
 
PPTX
Connecting Your In-Premise Database To Mobile Apps
Lohith Goudagere Nagaraj
 
PPT
Windows Azure Overview
akgiraud
 
PPTX
Typescript 102 angular and type script
Bob German
 
PPTX
Basics of Backbone.js
Avishekh Bharati
 
PPTX
Office 365 Intranet
Alan Eardley
 
PPTX
Few Tips for asp.net developers 2014 and beyond
Sreejesh Madonandy
 
PPTX
Cross platform app dev with xamarin forms
Shahriar Hossain
 
PPTX
Capture the Cloud with Azure
Shahed Chowdhuri
 
PPTX
Intro to modern web technology
Chris Love
 
PPTX
Welcome to the microsoft madness
명신 김
 
PPTX
Build HTML5 Sites/Apps with Kendo UI Core
Lohith Goudagere Nagaraj
 
PPTX
NativeScript + Push Notifications
Lohith Goudagere Nagaraj
 
PPTX
WebVR with Babylon.JS
Timmy Kokke
 
PDF
«The Grail: React based Isomorph apps framework»​
FDConf
 
Delivering Rich Content Applications at Scale with Nuxeo & MongoDB Atlas
Nuxeo
 
Web App Security
Shahed Chowdhuri
 
Modern web technologies
Oday Alqarra
 
Goldark Presentation at Qualcomm QPrize 2014
Leonardo Rossetti
 
Prototyping Mobile Apps with NativeScript and Angular
Mike Branstein
 
How to Win #BestMicrosoftHack with Azure
Shahed Chowdhuri
 
Connecting Your In-Premise Database To Mobile Apps
Lohith Goudagere Nagaraj
 
Windows Azure Overview
akgiraud
 
Typescript 102 angular and type script
Bob German
 
Basics of Backbone.js
Avishekh Bharati
 
Office 365 Intranet
Alan Eardley
 
Few Tips for asp.net developers 2014 and beyond
Sreejesh Madonandy
 
Cross platform app dev with xamarin forms
Shahriar Hossain
 
Capture the Cloud with Azure
Shahed Chowdhuri
 
Intro to modern web technology
Chris Love
 
Welcome to the microsoft madness
명신 김
 
Build HTML5 Sites/Apps with Kendo UI Core
Lohith Goudagere Nagaraj
 
NativeScript + Push Notifications
Lohith Goudagere Nagaraj
 
WebVR with Babylon.JS
Timmy Kokke
 
«The Grail: React based Isomorph apps framework»​
FDConf
 

Similar to Neoito — NativeScript Best Coding Practices (20)

PDF
Meetup. Technologies Intro for Non-Tech People
IT Arena
 
PPTX
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
chitrachauhan21
 
PDF
Great Responsive-ability Web Design
Mike Wilcox
 
PDF
Service worker API
Giorgio Natili
 
PPTX
Mobile Best Practices
mintersam
 
PPTX
Training presentation.pptx
NishchaiyaBayla1
 
PDF
Coding Ui
rajivmordani
 
PDF
Coding the UI
Mark Meeker
 
PDF
Responsive web design with various grids and frameworks comparison
DhrubaJyoti Dey
 
PDF
Asp.NETZERO - A Workshop Presentation by Citytech Software
Ritwik Das
 
PDF
Drupal performance and scalability
Twinbit
 
DOC
Sai Sharan_UI_Resume
Sai Sharan Madisetty
 
PPTX
Mobile web development
Moumie Soulemane
 
PDF
Workshop About Software Engineering Skills 2019
PhuocNT (Fresher.VN)
 
PDF
Lesson learned from 3 years with hybrid apps
Patrik Malmquist
 
DOC
KhajavaliShaik
khajavali shaik
 
KEY
Real-world Dojo Mobile
Andrew Ferrier
 
PDF
Bruce Lawson Opera Indonesia
brucelawson
 
PPT
The Mobile Development Landscape
Ambert Ho
 
PDF
Creating a Comprehensive Social Media App Using Ionic and Phone Gap
FITC
 
Meetup. Technologies Intro for Non-Tech People
IT Arena
 
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
chitrachauhan21
 
Great Responsive-ability Web Design
Mike Wilcox
 
Service worker API
Giorgio Natili
 
Mobile Best Practices
mintersam
 
Training presentation.pptx
NishchaiyaBayla1
 
Coding Ui
rajivmordani
 
Coding the UI
Mark Meeker
 
Responsive web design with various grids and frameworks comparison
DhrubaJyoti Dey
 
Asp.NETZERO - A Workshop Presentation by Citytech Software
Ritwik Das
 
Drupal performance and scalability
Twinbit
 
Sai Sharan_UI_Resume
Sai Sharan Madisetty
 
Mobile web development
Moumie Soulemane
 
Workshop About Software Engineering Skills 2019
PhuocNT (Fresher.VN)
 
Lesson learned from 3 years with hybrid apps
Patrik Malmquist
 
KhajavaliShaik
khajavali shaik
 
Real-world Dojo Mobile
Andrew Ferrier
 
Bruce Lawson Opera Indonesia
brucelawson
 
The Mobile Development Landscape
Ambert Ho
 
Creating a Comprehensive Social Media App Using Ionic and Phone Gap
FITC
 
Ad

More from Neoito (14)

PDF
Neoito — *NIX kungfu for web devs
Neoito
 
PDF
Neoito — Secure coding practices
Neoito
 
PDF
Neoito — How modern browsers work
Neoito
 
PDF
Neoito — React 101
Neoito
 
PDF
Neoito — Scaling node.js
Neoito
 
PPTX
Neoito — Grid layout
Neoito
 
PDF
Neoito — Software licensing
Neoito
 
PPTX
Neoito — GitLab for project management
Neoito
 
PPTX
Neoito — Routing and navigation in Angular
Neoito
 
PDF
Neoito — Animations in Angular 5
Neoito
 
PDF
Neoito — A roadmap to Angular
Neoito
 
PDF
Neoito — Intro to WebSockets
Neoito
 
PDF
Neoito — Typography for the web
Neoito
 
PPTX
Neoito — Design patterns and depenedency injection
Neoito
 
Neoito — *NIX kungfu for web devs
Neoito
 
Neoito — Secure coding practices
Neoito
 
Neoito — How modern browsers work
Neoito
 
Neoito — React 101
Neoito
 
Neoito — Scaling node.js
Neoito
 
Neoito — Grid layout
Neoito
 
Neoito — Software licensing
Neoito
 
Neoito — GitLab for project management
Neoito
 
Neoito — Routing and navigation in Angular
Neoito
 
Neoito — Animations in Angular 5
Neoito
 
Neoito — A roadmap to Angular
Neoito
 
Neoito — Intro to WebSockets
Neoito
 
Neoito — Typography for the web
Neoito
 
Neoito — Design patterns and depenedency injection
Neoito
 
Ad

Recently uploaded (20)

PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PDF
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PPTX
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PPTX
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
Top Agile Project Management Tools for Teams in 2025
Orangescrum
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
OpenChain @ OSS NA - In From the Cold: Open Source as Part of Mainstream Soft...
Shane Coughlan
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
Tally software_Introduction_Presentation
AditiBansal54083
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Foundations of Marketo Engage - Powering Campaigns with Marketo Personalization
bbedford2
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 

Neoito — NativeScript Best Coding Practices

  • 2. A free and open source framework for building truly native mobile apps with JavaScript. Use web skills, like TypeScript, Angular, Vue and CSS, and get native UI and performance on iOS and Android. NativeScript is…
  • 3. 5 Reasons to use NativeScript • 1) Rich, animated native UI • 2) Maximum code and skill reusability • 3) Ease of doing native-y things • 4) Vibrant and growing community • 5) Supported by a major software company
  • 7. Reuse existing native Android and iOS libraries
  • 10. How we can improve the performance of the NS Apps
  • 11. Architecting your application correctly can have a significant impact on navigation time, on-page render performance and application maintenance
  • 12. Web Mentality in Native Applications Does Not Work Code For a Showing a simple dropdown with date and Alphabet <StackLayout borderColor="#D6D6E4" borderWidth="1" borderRadius="5" backgroundColor="white"> <StackLayout orientation="horizontal"> <Label class="accent" text="Date"></Label> <!-- Custom Icon Directive --> <Label horizontalAlignment="right" icon=“sort"></Label> </StackLayout> <StackLayout orientation="horizontal" <Label text="Alphabetical"></Label> </StackLayout> </StackLayout> When this code renders natively you create 3 view containers.Assume you follow this mentality for the navigation, the card design, the search bar and every other micro component in your application…. You start to end up with huge rendering burden for your native application.
  • 13. NativeScript is Single Threaded • All the UI and interactions are ran on the main UI thread • This means you are taxing your application for each container it has to render. The number of containers also affect the performance of the underlying native frameworks and their rendering and layout times NativeScript does allow you to use background workers, but these are not meant for UI and are instead used for services such as http calls, large data manipulations, etc.
  • 15. UI OPTIMIZATION TECHNIQUES 1. Avoid nested layouts 2. Use the least possible UI elements to build a component 3. Avoid inline styles as much as possible 4. Try to reuse the most of NativeScript Theme 5. Use only lowercase and dashes for selectors 6. Prefer HEX over RGB color codes 7. Define global / local SCSS variables as needed
  • 16. Angular Optimisation Techniques • Webpack, AOT and Uglify Application will bootstrap faster - eliminating a lot of the “white screen” effects you may be experiencing and the size of the application will be reduced. • Lazy Loaded Modules By breaking up your modules, they will be built into separate “chunks”. This means your application will only request that chunk when it actually needs it. This avoids a lot of overhead with fetching more information than your application needs per view. • Wrapping Complex Views By delaying the rendering of complex views, it allows your navigation event to complete soon on the main thread, giving your user the illusion that the app isn’t lagging
  • 17. • Reduce View Complexity Some designs just do not make sense for a native application, especially a NativeScript application. NativeScript is prestigious for its ability to access native APIs - not rendering complex UI • Use Local Database Using database like couch db or sqlite for storing data instead of saving it in cache for large applications