NativeScript

Last updated
NativeScript
Original author(s) Telerik by Progress Software. [1]
Developer(s) Community
Initial release2014 (2014)
Stable release
8.8.1 / July 11, 2024;2 months ago (2024-07-11) [2]
Repository
Written in JavaScript, TypeScript
Platform Cross-platform
License Apache License 2.0
Website nativescript.org

NativeScript provides platform APIs directly to the JavaScript runtime (with strong types) for a rich TypeScript development experience. As an open-source framework to develop apps for iOS, visionOS and Android platforms combining a best of all worlds approach marrying familiar Web approaches like CSS and view templating with common platform languages (Swift, Kotlin, Objective-C, Java) it delivers a liberating toolset for developers. It was originally conceived and developed by Bulgarian company Telerik, later acquired by Progress Software. [3] At the end of 2019 [4] responsibility for the NativeScript project was taken over by long-time Progress partner, nStudio. In December 2020, nStudio also oversaw the induction of NativeScript into OpenJS Foundation as an Incubating Project. [5] NativeScript apps are built using JavaScript, or by using any programming language that transpiles to JavaScript, such as TypeScript. NativeScript supports the Angular [6] and Vue JavaScript frameworks. [7] Mobile applications built with NativeScript result in fully native apps, which use the same APIs as if they were developed in Xcode or Android Studio. [8] Additionally, software developers can re-purpose third-party libraries from CocoaPods, Maven, and npm.js in their mobile applications without the need for wrappers. [9] [10] [11]

Contents

Development

NativeScript was publicly released first in March 2015. Version 1.0.0 followed two months later. [12] The framework quickly gained popularity reaching 3000 github-stars and over 1500 followers on Twitter soon after the public release. [13] In the meantime, over 700 plugins are available, which are either officially supported by Progress or stem from the open source community. [14] [15] The use of Angular is an optional development approach allowing for application source code to be shared between the web platform and mobile platform. [16]

Structure

NativeScript and all the required plugins are installed using the package manager npm. Projects are created, configured, and compiled via the command line or a GUI tool called NativeScript Sidekick. [17] Platform-independent user interfaces are defined using XML files. NativeScript then uses the abstractions described in the XML files to call native UI elements of each platform. Application logic developed in Angular and TypeScript can be developed independent of the target platform as well. A NativeScript mobile application is built using the node.js runtime and tooling. [18] Progress aims for a ratio of 90% common code between the iOS and Android platforms. [1]

Direct access to native platform APIs and controls

Platform-independent user interfaces are defined using XML files. [19] NativeScript uses the XML data structures representing the cross platform abstraction to trigger platform-specific code that directly interacts with the native elements of the target operating system. This means a call to the NativeScript Button API provides a UI abstraction for Button, which directly calls UIButton on iOS [20] or com.android.widget.Button on Android. [21]

While application source code is written in JavaScript, TypeScript, Angular, or Vue.js, the source code is not compiled or otherwise mutated. The source code as-is runs directly on the device. This architectural choice eliminates the need for cross-compiling or transpiling. [11] Additionally, while the application source code is written in languages commonly encountered in a browser (or in a WebView-contained mobile application) NativeScript applications run directly on the native device. There is no DOM manipulation or any mandatory browser interaction. [6]

Notable features

Native API reflection

Another notable feature is the use of reflection to handle native API endpoints. Rather than requiring separate binding layers between NativeScript and each mobile platform API, NativeScript uses reflection to gain information and metadata about the native platform APIs. New features added to any native platform API are available immediately. [6]

Another way the reflection feature is used is in working with third party libraries. As JavaScript (or TypeScript/Angular) can talk directly to native code, there is no need to write binding layers in Objective-C, Swift, Java or Kotlin. [11] [22]

Angular integration

With the launch of NativeScript 2.0, it is possible to use Angular to build cross-platform mobile applications. [23] Additionally, when using Angular with NativeScript you have the ability to share large chunks of code between your web and mobile apps. [24]

Vue.js integration

The Vue.js framework is supported in NativeScript via the nativescript-vue plugin. [7]

Supporting tools and services

Related Research Articles

In computing, cross-platform software is computer software that is designed to work in several computing platforms. Some cross-platform software requires a separate build for each platform, but some can be directly run on any platform without special preparation, being written in an interpreted language or compiled to portable bytecode for which the interpreters or run-time packages are common or standard components of all supported platforms.

<span class="mw-page-title-main">NASA WorldWind</span> Open-source virtual globe

NASA WorldWind is an open-source virtual globe. According to the website, "WorldWind is an open source virtual globe API. WorldWind allows developers to quickly and easily create interactive visualizations of 3D globe, map and geographical information. Organizations around the world use WorldWind to monitor weather patterns, visualize cities and terrain, track vehicle movement, analyze geospatial data and educate humanity about the Earth." It was first developed by NASA in 2003 for use on personal computers and then further developed in concert with the open source community since 2004. As of 2017, a web-based version of WorldWind is available online. An Android version is also available.

<span class="mw-page-title-main">Adobe AIR</span> Cross-platform runtime system for building rich web applications

Adobe AIR is a cross-platform runtime system currently developed by Harman International, in collaboration with Adobe Inc., for building desktop applications and mobile applications, programmed using Adobe Animate, ActionScript, and optionally Apache Flex. It was originally released in 2008. The runtime supports installable applications on Windows, macOS, and mobile operating systems, including Android, iOS, and BlackBerry Tablet OS.

<span class="mw-page-title-main">JavaFX</span> Java software platform for GUI

JavaFX is a software platform for creating and delivering desktop applications, as well as rich web applications that can run across a wide variety of devices. JavaFX has support for desktop computers and web browsers on Microsoft Windows, Linux, and macOS, as well as mobile devices running iOS and Android, through Gluon Mobile.

NS Basic is a family of development tools developed and commercially marketed by NSB Corporation in Toronto, Ontario, Canada for iOS, Android, Microsoft Windows, MacOS, Linux, BlackBerry OS, WebOS, Newton OS, Palm OS, Windows CE and Windows Mobile.

The Android Package with the file extension apk is the file format used by the Android operating system, and a number of other Android-based operating systems for distribution and installation of mobile apps, mobile games and middleware. A file using this format can be built from source code written in either Java or Kotlin.

Apache Cordova is a mobile application development framework created by Nitobi. Adobe Systems purchased Nitobi in 2011, rebranded it as PhoneGap, and later released an open-source version of the software called Apache Cordova. Apache Cordova enables software programmers to build hybrid web applications for mobile devices using CSS3, HTML5, and JavaScript, instead of relying on platform-specific APIs like those in Android, iOS, or Windows Phone. It enables the wrapping up of CSS, HTML, and JavaScript code depending on the platform of the device. It extends the features of HTML and JavaScript to work with the device. The resulting applications are hybrid, meaning that they are neither truly native mobile application nor purely Web-based. They are not native because all layout rendering is done via Web views instead of the platform's native UI framework. They are not Web apps because they are packaged as apps for distribution and have access to native device APIs. Mixing native and hybrid code snippets has been possible since version 1.9.

Titanium SDK is an open-source framework that allows the creation of native mobile applications on platforms iOS and Android from a single JavaScript codebase. It is presently developed by non-profit software foundation TiDev, Inc.

<span class="mw-page-title-main">Node.js</span> JavaScript runtime environment

Node.js is a cross-platform, open-source JavaScript runtime environment that can run on Windows, Linux, Unix, macOS, and more. Node.js runs on the V8 JavaScript engine, and executes JavaScript code outside a web browser.

<span class="mw-page-title-main">Sencha Touch</span> JavaScript framework

Sencha Touch is a user interface (UI) JavaScript library, or web framework, specifically built for the Mobile Web. It can be used by Web developers to develop user interfaces for mobile web applications that look and feel like native applications on supported mobile devices. It is based on web standards such as HTML5, CSS3 and JavaScript. The goal of Sencha Touch is to facilitate quick and easy development of HTML5 based mobile apps which run on Android, iOS, Windows, Tizen and BlackBerry devices, simultaneously allowing a native look and feel to the apps.

Dart is a programming language designed by Lars Bak and Kasper Lund and developed by Google. It can be used to develop web and mobile apps as well as server and desktop applications.

Codename One is an open-source cross-platform framework aiming to provide write once, run anywhere code for various mobile and desktop operating systems. It was created by the co-founders of the Lightweight User Interface Toolkit (LWUIT) project, Chen Fishbein and Shai Almog, and was first announced on January 13, 2012.

<span class="mw-page-title-main">OpenFL</span> Software framework for video games

OpenFL is a free and open-source software framework and platform for the creation of multi-platform applications and video games. OpenFL applications can be written in Haxe, JavaScript, or TypeScript, and may be published as standalone applications for several targets including iOS, Android, HTML5, Windows, macOS, Linux, WebAssembly, Flash, AIR, PlayStation 4, PlayStation 3, PlayStation Vita, Xbox One, Wii U, TiVo, Raspberry Pi, and Node.js.

<span class="mw-page-title-main">Ionic (mobile app framework)</span> Open-source framework to develop hybrid mobile apps

Ionic is an open-source UI toolkit for building cross-platform mobile, web, and desktop applications using web technologies such as HTML, CSS, and JavaScript/TypeScript. It provides a set of pre-designed UI components and tools for building high-quality, interactive applications. Ionic was originally built as a complete open-source SDK for hybrid mobile app development created by Max Lynch, Ben Sperry, and Adam Bradley of Drifty Co. in 2013. The original version was released in 2013 and built on top of AngularJS and Apache Cordova. However, the latest release was re-built as a set of Web Components using StencilJS, allowing the user to choose any user interface framework, such as Angular, React or Vue.js. It also allows the use of Ionic components with no user interface framework at all. Ionic provides tools and services for developing hybrid mobile, desktop, and progressive web apps based on modern web development technologies and practices, using Web technologies like CSS, HTML5, and Sass. In particular, mobile apps can be built with these Web technologies and then distributed through native app stores to be installed on devices by utilizing Cordova or Capacitor.

Crosswalk Project was an open-source web app runtime built with the latest releases of Chromium and Blink from Google. The project was founded by Intel's Open Source Technology Center in September 2013.

Flutter is an open-source UI software development kit created by Google. It can be used to develop cross platform applications from a single codebase for the web, Fuchsia, Android, iOS, Linux, macOS, and Windows. First described in 2015, Flutter was released in May 2017. Flutter is used internally by Google in apps such as Google Pay and Google Earth as well as other software developers including ByteDance and Alibaba.

<span class="mw-page-title-main">Quasar Framework</span> JavaScript framework

The Quasar Framework is an open-source Vue.js based framework for building apps with a single codebase. It can be deployed on the Web as a SPA, PWA, SSR, to a Mobile App, using Cordova for iOS & Android, and to a Desktop App, using Electron for Mac, Windows, and Linux. Quasar was created by Razvan Stoenescu and is maintained by a small team of developers and contributors. Most from the core team currently work at various companies such as Lenovo, IntelliView Technologies Inc. and AG Development Services.

<span class="mw-page-title-main">Appery.io</span> App-building platform

Appery.io is a cloud-based HTML5, Ionic, jQuery Mobile, and hybrid app-building platform for developing mobile apps, web apps, and PWAs. Appery.io is a browser-based drag-and-drop visual builder tool that supports Android and iOS with integrated Apache Cordova/PhoneGap output. The platform is used by DIYers to create apps for their customers.

References

  1. 1 2 "Frequently asked questions about NativeScript". NativeScript.org. Archived from the original on 2016-03-18. Retrieved 2016-03-20.
  2. "Releases · NativeScript/NativeScript". GitHub. Archived from the original on 2021-08-31. Retrieved 2024-07-11.
  3. "Creating Mobile Native Apps in JavaScript with NativeScript". InfoQ. Archived from the original on 2022-06-19. Retrieved 2022-07-12.
  4. Saripella, Surya. "The Next Chapter for NativeScript: nStudio". NativeScript. Archived from the original on 2021-01-16. Retrieved 2022-07-12.
  5. Romoff, Rachel (7 December 2020). "NativeScript joins OpenJS Foundation as Incubating Project". The Linux Foundation Projects. OpenJS Foundation. Archived from the original on 25 January 2021. Retrieved 4 March 2021.
  6. 1 2 3 Krill, Paul (March 10, 2015). "JavaScript goes native for iOS, Android, and Windows Phone apps". InfoWorld. Archived from the original on January 3, 2022. Retrieved July 12, 2022.
  7. 1 2 "NativeScript-Vue". nativescript-vue.org. Retrieved 2017-10-31.
  8. "NativeScript framework eases cross-platform app development woes". searchcloudcomputing.techtarget.com. Archived from the original on 2021-08-06. Retrieved 2021-08-06.
  9. Krill, Paul (May 6, 2016). "NativeScript warms up to AngularJS for mobile dev". InfoWorld. Archived from the original on June 12, 2022. Retrieved July 12, 2022.
  10. "SD Times GitHub Project of the Week: NativeScript". March 18, 2016. Archived from the original on March 27, 2022. Retrieved July 12, 2022.
  11. 1 2 3 "Telerik's NativeScript Aims To Centralize Cross-Platform Mobile Development -". Visual Studio Magazine. Archived from the original on 2017-11-07. Retrieved 2016-11-21.
  12. "NativeScript 1.0.0 Released". www.i-programmer.info. Archived from the original on 2022-06-11. Retrieved 2022-07-12.
  13. "NativeScript 1.0.0 is now available". NativeScript.org. Archived from the original on 2016-10-05. Retrieved 2016-11-04.
  14. "NativeScript Marketplace". market.nativescript.org. Archived from the original on 2018-03-15. Retrieved 2018-03-14.
  15. "nativescript - npm search". www.npmjs.com. Archived from the original on 2017-02-11. Retrieved 2016-11-21.
  16. "Getting to Know Angular 2". mobile.htmlgoodies.com. 15 November 2016. Archived from the original on 27 September 2019. Retrieved 12 July 2022.
  17. "NativeScript Sidekick - your faithful companion for app development". NativeScript.org. Archived from the original on 2017-11-07. Retrieved 2017-10-31.
  18. Hanna, Tam. "Mit JavaScript wie hausgemacht: NativeScript". Developer. Archived from the original on 2021-07-25. Retrieved 2022-07-12.
  19. "The Basics - NativeScript Docs". docs.nativescript.org. Archived from the original on 2016-11-21. Retrieved 2016-11-21.
  20. "NativeScript/NativeScript". github.com. Archived from the original on 2022-06-20. Retrieved 2022-06-20.
  21. "NativeScript/NativeScript". github.com. Archived from the original on 2022-06-20. Retrieved 2022-06-20.
  22. "Accessing Native APIs through JavaScript - NativeScript Docs". docs.nativescript.org. Archived from the original on 2016-11-24. Retrieved 2016-11-21.
  23. "NativeScript 2.0 - the best way to build cross-platform native mobile apps". NativeScript.org. Archived from the original on 2016-12-20. Retrieved 2016-11-21.
  24. Witalec, Sebastian (2018-08-24). "Apps That Work Natively on the Web and Mobile". Medium. Archived from the original on 2022-01-03. Retrieved 2021-08-06.