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

PDF
Front End Applications Using One Stop JavaScript Library from Telerik
PPTX
Getting Started with ASP.NET vNext
PDF
NetApp MVC Project PPT
PPTX
Jumpstart your ASP.NET Project Development with Sitefinity Platform
PPTX
Introduction to NativeScript - BuildTruly Native Apps using JavaScript
PPTX
Native Touches to your Hybrid Mobile Apps
PDF
Solving Enteprise Mobility Considerations with Telerik Mobile Platform
PPTX
Server Side Responsive Layouts for ASP.NET WebForms using Telerik UI for ASP....
Front End Applications Using One Stop JavaScript Library from Telerik
Getting Started with ASP.NET vNext
NetApp MVC Project PPT
Jumpstart your ASP.NET Project Development with Sitefinity Platform
Introduction to NativeScript - BuildTruly Native Apps using JavaScript
Native Touches to your Hybrid Mobile Apps
Solving Enteprise Mobility Considerations with Telerik Mobile Platform
Server Side Responsive Layouts for ASP.NET WebForms using Telerik UI for ASP....

What's hot (20)

PPTX
Delivering Rich Content Applications at Scale with Nuxeo & MongoDB Atlas
PPTX
Web App Security
PDF
Modern web technologies
PPTX
Goldark Presentation at Qualcomm QPrize 2014
PPTX
Prototyping Mobile Apps with NativeScript and Angular
PPTX
How to Win #BestMicrosoftHack with Azure
PPTX
Connecting Your In-Premise Database To Mobile Apps
PPT
Windows Azure Overview
PPTX
Typescript 102 angular and type script
PPTX
Basics of Backbone.js
PPTX
Office 365 Intranet
PPTX
Few Tips for asp.net developers 2014 and beyond
PPTX
Cross platform app dev with xamarin forms
PPTX
Capture the Cloud with Azure
PPTX
Intro to modern web technology
PPTX
Welcome to the microsoft madness
PPTX
Build HTML5 Sites/Apps with Kendo UI Core
PPTX
NativeScript + Push Notifications
PPTX
WebVR with Babylon.JS
PDF
«The Grail: React based Isomorph apps framework»​
Delivering Rich Content Applications at Scale with Nuxeo & MongoDB Atlas
Web App Security
Modern web technologies
Goldark Presentation at Qualcomm QPrize 2014
Prototyping Mobile Apps with NativeScript and Angular
How to Win #BestMicrosoftHack with Azure
Connecting Your In-Premise Database To Mobile Apps
Windows Azure Overview
Typescript 102 angular and type script
Basics of Backbone.js
Office 365 Intranet
Few Tips for asp.net developers 2014 and beyond
Cross platform app dev with xamarin forms
Capture the Cloud with Azure
Intro to modern web technology
Welcome to the microsoft madness
Build HTML5 Sites/Apps with Kendo UI Core
NativeScript + Push Notifications
WebVR with Babylon.JS
«The Grail: React based Isomorph apps framework»​
Ad

Similar to Neoito — NativeScript Best Coding Practices (20)

PDF
Meetup. Technologies Intro for Non-Tech People
PPTX
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
PDF
Great Responsive-ability Web Design
PDF
Service worker API
PPTX
Mobile Best Practices
PPTX
Training presentation.pptx
PDF
Coding the UI
PDF
Coding Ui
PDF
Responsive web design with various grids and frameworks comparison
PDF
Asp.NETZERO - A Workshop Presentation by Citytech Software
PDF
Drupal performance and scalability
DOC
Sai Sharan_UI_Resume
PPTX
Mobile web development
PDF
Workshop About Software Engineering Skills 2019
PDF
Lesson learned from 3 years with hybrid apps
DOC
KhajavaliShaik
KEY
Real-world Dojo Mobile
PDF
Bruce Lawson Opera Indonesia
PPT
The Mobile Development Landscape
PDF
Creating a Comprehensive Social Media App Using Ionic and Phone Gap
Meetup. Technologies Intro for Non-Tech People
LATEST_TRENDS_IN_WEBSITE_DEVELOPMENT.pptx
Great Responsive-ability Web Design
Service worker API
Mobile Best Practices
Training presentation.pptx
Coding the UI
Coding Ui
Responsive web design with various grids and frameworks comparison
Asp.NETZERO - A Workshop Presentation by Citytech Software
Drupal performance and scalability
Sai Sharan_UI_Resume
Mobile web development
Workshop About Software Engineering Skills 2019
Lesson learned from 3 years with hybrid apps
KhajavaliShaik
Real-world Dojo Mobile
Bruce Lawson Opera Indonesia
The Mobile Development Landscape
Creating a Comprehensive Social Media App Using Ionic and Phone Gap
Ad

More from Neoito (14)

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

Recently uploaded (20)

PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
L1 - Introduction to python Backend.pptx
PDF
top salesforce developer skills in 2025.pdf
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Digital Strategies for Manufacturing Companies
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
System and Network Administraation Chapter 3
PDF
PTS Company Brochure 2025 (1).pdf.......
PPTX
Introduction to Artificial Intelligence
PDF
System and Network Administration Chapter 2
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Design an Analysis of Algorithms II-SECS-1021-03
Operating system designcfffgfgggggggvggggggggg
wealthsignaloriginal-com-DS-text-... (1).pdf
L1 - Introduction to python Backend.pptx
top salesforce developer skills in 2025.pdf
Odoo Companies in India – Driving Business Transformation.pdf
How to Choose the Right IT Partner for Your Business in Malaysia
Digital Strategies for Manufacturing Companies
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
VVF-Customer-Presentation2025-Ver1.9.pptx
CHAPTER 2 - PM Management and IT Context
Which alternative to Crystal Reports is best for small or large businesses.pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
2025 Textile ERP Trends: SAP, Odoo & Oracle
System and Network Administraation Chapter 3
PTS Company Brochure 2025 (1).pdf.......
Introduction to Artificial Intelligence
System and Network Administration Chapter 2

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