NativeScript: Difference between revisions

Content deleted Content added
Updated stable release
rm more inline linking, copyedit
 
(47 intermediate revisions by 34 users not shown)
Line 1:
{{Advert|date=October 2024}}
{{Short description|Open-source framework to develop native mobile apps}}
{{Infobox software
| logo = NativeScript logoLogo.png
| logo_size = 64px
| name = NativeScript
| author = [[Telerik]] by [[Progress Software]].<ref name="nativescript.org"/>
| developer = Community
| developer = [[Progress Software|Progress]] and community
| released = {{Start date|2014}}
| latest release version = 7.0.12{{wikidata|property|edit|reference|P348}}
| latest release date = {{Startstart date and age|2020{{wikidata|10qualifier|21P348|P577}}}}<ref>https://github.com/NativeScript/NativeScript/releases</ref>
| programming language = [[JavaScript]], [[TypeScript]]
| platform = [[Cross-platform]]
| license = [[Apache License 2.0]]
| website = {{URL|www.https://nativescript.org}}
}}
 
'''NativeScript''' is a [[JavaScript]]-based cross-platform [[open-source software|open-source]] development framework to develop [[mobile app|apps]] for [[iOS]], [[visionOS]] and [[Android (operating system)|Android]] platforms. It connects platform APIs directly to the JavaScript runtime (with strong types). combining familiar Web approaches like CSS and view templating with common platform languages ([[Swift (programming language)|Swift]], [[Kotlin (programming language)|Kotlin]], [[Objective-C]], [[Java (programming language)|Java]]).
'''NativeScript''' is an [[open-source software|open-source]] framework to develop apps on the [[iOS|Apple iOS]] and [[Android (operating system)|Android]] platforms. It was originally conceived and developed by Progress.<ref>https://www.infoq.com/news/2015/03/nativescript</ref> NativeScript apps are built using [[JavaScript]], or by using any language that transpiles to JavaScript, such as [[TypeScript]]. NativeScript supports the [[Angular (application platform)|Angular]]<ref name=infoworld2893706>http://www.infoworld.com/article/2893706/mobile-development/javascript-native-ios-android-and-windows-phone-apps.html</ref> and [[Vue.js|Vue]] JavaScript frameworks.<ref name=":0">{{Cite web|url=https://nativescript-vue.org/#/|title={N}-Vue|website=nativescript-vue.org|access-date=2017-10-31}}</ref> 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]].<ref>http://searchcloudapplications.techtarget.com/podcast/NativeScript-framework-eases-cross-platform-app-development-woes</ref> Additionally, software developers can re-purpose third-party libraries from [[CocoaPods]], [[Maven]], and [[npm (software)|npm.js]] in their mobile applications without the need for wrappers.<ref>http://www.infoworld.com/article/3066900/javascript/nativescript-warms-up-to-angularjs-for-mobile-dev.html</ref><ref>http://sdtimes.com/sd-times-github-project-of-the-week-nativescript/</ref><ref name=visualstudiomagazine20150309>https://visualstudiomagazine.com/articles/2015/03/09/telerik-nativescript-beta-mobile.aspx</ref>
 
It was originally conceived and developed by Bulgarian company [[Telerik]], later acquired by [[Progress Software]].<ref>{{Cite web|url=https://www.infoq.com/news/2015/03/nativescript/|title=Creating Mobile Native Apps in JavaScript with NativeScript|website=InfoQ|access-date=2022-07-12|archive-date=2022-06-19|archive-url=https://web.archive.org/web/20220619183512/https://www.infoq.com/news/2015/03/nativescript/|url-status=live}}</ref> At the end of 2019<ref>{{cite web |last1=Saripella |first1=Surya |title=The Next Chapter for NativeScript: nStudio |url=https://nativescript.org/blog/the-next-chapter-for-nativescript-nstudio/ |publisher=NativeScript |access-date=2022-07-12 |archive-date=2021-01-16 |archive-url=https://web.archive.org/web/20210116145010/https://nativescript.org/blog/the-next-chapter-for-nativescript-nstudio/ |url-status=live }}</ref> 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 the [[OpenJS Foundation]] as an Incubating Project.<ref>{{cite web |last1=Romoff |first1=Rachel |title=NativeScript joins OpenJS Foundation as Incubating Project |url=https://openjsf.org/blog/2020/12/07/nativescript-joins-openjs-foundation-as-incubating-project/ |website=The Linux Foundation Projects |date=7 December 2020 |publisher=OpenJS Foundation |access-date=4 March 2021 |archive-date=25 January 2021 |archive-url=https://web.archive.org/web/20210125120950/https://openjsf.org/blog/2020/12/07/nativescript-joins-openjs-foundation-as-incubating-project/ |url-status=live }}</ref> NativeScript apps are built using [[JavaScript]], or by using any [[programming language]] that [[transpile]]s to JavaScript, such as [[TypeScript]]. NativeScript supports the [[Angular (application platform)|Angular]]<ref name="infoworld2893706">{{Cite web|url=https://www.infoworld.com/article/2893706/javascript-native-ios-android-and-windows-phone-apps.html|title=JavaScript goes native for iOS, Android, and Windows Phone apps|first=Paul|last=Krill|date=March 10, 2015|website=InfoWorld|access-date=July 12, 2022|archive-date=January 3, 2022|archive-url=https://web.archive.org/web/20220103083812/https://www.infoworld.com/article/2893706/javascript-native-ios-android-and-windows-phone-apps.html|url-status=live}}</ref> and [[Vue.js|Vue]] JavaScript frameworks.<ref name=":0">{{Cite web|url=https://nativescript-vue.org/#/|title=NativeScript-Vue|website=nativescript-vue.org|access-date=2017-10-31}}</ref> 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]].<ref>{{Cite web|title=NativeScript framework eases cross-platform app development woes|url=https://searchcloudcomputing.techtarget.com/podcast/NativeScript-framework-eases-cross-platform-app-development-woes|access-date=2021-08-06|website=searchcloudcomputing.techtarget.com|archive-date=2021-08-06|archive-url=https://web.archive.org/web/20210806104010/https://searchcloudcomputing.techtarget.com/podcast/NativeScript-framework-eases-cross-platform-app-development-woes|url-status=live}}</ref> Additionally, software developers can re-purpose third-party libraries from [[CocoaPods]], [[Apache Maven|Maven]], and [[npm (software)|npm.js]] in their mobile applications without the need for wrappers.<ref>{{Cite web|url=https://www.infoworld.com/article/3066900/nativescript-warms-up-to-angularjs-for-mobile-dev.html|title=NativeScript warms up to AngularJS for mobile dev|first=Paul|last=Krill|date=May 6, 2016|website=InfoWorld|access-date=July 12, 2022|archive-date=June 12, 2022|archive-url=https://web.archive.org/web/20220612180823/https://www.infoworld.com/article/3066900/nativescript-warms-up-to-angularjs-for-mobile-dev.html|url-status=live}}</ref><ref>{{Cite web|url=https://sdtimes.com/alphago/sd-times-github-project-of-the-week-nativescript/|title=SD Times GitHub Project of the Week: NativeScript|date=March 18, 2016|access-date=July 12, 2022|archive-date=March 27, 2022|archive-url=https://web.archive.org/web/20220327145317/https://sdtimes.com/alphago/sd-times-github-project-of-the-week-nativescript/|url-status=live}}</ref><ref name="visualstudiomagazine20150309">{{Cite web|url=https://visualstudiomagazine.com/articles/2015/03/09/telerik-nativescript-beta-mobile.aspx|title=Telerik's NativeScript Aims To Centralize Cross-Platform Mobile Development -|website=Visual Studio Magazine|access-date=2016-11-21|archive-date=2017-11-07|archive-url=https://web.archive.org/web/20171107003801/https://visualstudiomagazine.com/articles/2015/03/09/telerik-nativescript-beta-mobile.aspx|url-status=live}}</ref>
 
==Development==
NativeScript was publicly released first in March 2015. Version 1.0.0 followed two months later.<ref>http{{Cite web|url=https://www.i-programmer.info/news/167-javascript/8561-nativescript-100-released.html|title=NativeScript 1.0.0 Released|website=www.i-programmer.info|access-date=2022-07-12|archive-date=2022-06-11|archive-url=https://web.archive.org/web/20220611085454/https://www.i-programmer.info/news/167-javascript/8561-nativescript-100-released.html|url-status=live}}</ref> The framework quickly gained popularity reaching 3000 github-stars and over 1500 followers on Twitter soon after the public release.<ref>{{Cite web|url=https://www.nativescript.org/blog/nativescript-1.0.0-is-now-available|title=NativeScript 1.0.0 is now available|website=NativeScript.org|access-date=2016-11-04|archive-date=2016-10-05|archive-url=https://web.archive.org/web/20161005103930/https://www.nativescript.org/blog/nativescript-1.0.0-is-now-available|url-status=live}}</ref> In the meantime, over 700 plugins are available, which are either officially supported by Progress or stem from the open source community.<ref>{{Cite web|url=https://market.nativescript.org/|title=NativeScript Marketplace|website=market.nativescript.org|access-date=2018-03-14|archive-date=2018-03-15|archive-url=https://web.archive.org/web/20180315133334/https://market.nativescript.org/|url-status=live}}</ref><ref>{{Cite web|url=https://www.npmjs.com/search?q=nativescript|title=nativescript - npm search|website=www.npmjs.com|access-date=2016-11-21|archive-date=2017-02-11|archive-url=https://web.archive.org/web/20170211155805/https://www.npmjs.com/search?q=nativescript|url-status=live}}</ref> The use of Angular is an optional development approach allowing for application source code to be shared between the web platform and mobile platform.<ref>http{{Cite web|url=https://wwwmobile.cioreviewhtmlgoodies.com/newsbeyond/progressjavascript/getting-releasesto-nativescriptknow-20angular-with2.html|title=Getting to Know Angular 2|website=mobile.htmlgoodies.com|date=15 November 2016|access-crossplatformdate=12 July 2022|archive-deploymentdate=27 September 2019|archive-capabilities-nid-14646-cid-19url=https://web.html<archive.org/ref><ref>httpweb/20190927013701/https://wwwmobile.htmlgoodies.com/beyond/javascript/getting-to-know-angular-2.html|url-status=live}}</ref>
 
==Structure==
NativeScript and all the required plugins are installed using the package manager [[Npm (software)|npm]]. Projects are created, configured, and compiled via the command line or a GUI tool called NativeScript Sidekick.<ref>{{Cite web|url=https://www.nativescript.org/nativescript-sidekick|title=NativeScript Sidekick - your faithful companion for app development|website=NativeScript.org|language=en|access-date=2017-10-31|archive-date=2017-11-07|archive-url=https://web.archive.org/web/20171107004639/https://www.nativescript.org/nativescript-sidekick|url-status=live}}</ref>
 
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.<ref name="heisede3282619">http{{Cite web|url=https://www.heise.de/developer/artikel/Mit-JavaScript-wie-hausgemacht-NativeScript-3282619.html|title=Mit JavaScript wie hausgemacht: NativeScript|first=Tam|last=Hanna|website=Developer|date=9 August 2016 |access-date=2022-07-12|archive-date=2021-07-25|archive-url=https://web.archive.org/web/20210725085644/https://www.heise.de/developer/artikel/Mit-JavaScript-wie-hausgemacht-NativeScript-3282619.html|url-status=live}}</ref> Progress aims for a ratio of 90% common code between the iOS and Android platforms.<ref name="nativescript.org">{{Cite web|url=https://www.nativescript.org/faq|title=Frequently asked questions about NativeScript|website=NativeScript.org|access-date=2016-03-20|archive-date=2016-03-18|archive-url=https://web.archive.org/web/20160318132229/https://www.nativescript.org/|url-status=live}}</ref>
 
==Direct Accessaccess to Nativenative Platformplatform APIs and Controlscontrols==
Platform-independent user interfaces are defined using [[XML]] files.<ref>{{Cite web|url=https://docs.nativescript.org/ui/basics|title=The Basics - NativeScript Docs|website=docs.nativescript.org|access-date=2016-11-21|archive-date=2016-11-21|archive-url=https://web.archive.org/web/20161121191907/http://docs.nativescript.org/ui/basics|url-status=live}}</ref> 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 <ref>{{Cite web|url=https://github.com/NativeScript/NativeScript/blob/master/tns-packages/core-modules/ui/button/index.ios.ts|title=NativeScript/NativeScript|website=github.com|access-date=2022-06-20|archive-date=2022-06-20|archive-url=https://web.archive.org/web/20220620103533/https://github.com/NativeScript/NativeScript/blob/master/packages/core/ui/button/index.ios.ts|url-status=live}}</ref> or com.android.widget.Button on Android.<ref>{{Cite web|url=https://github.com/NativeScript/NativeScript/blob/master/tns-packages/core-modules/ui/button/index.android.ts|title=NativeScript/NativeScript|website=github.com|access-date=2022-06-20|archive-date=2022-06-20|archive-url=https://web.archive.org/web/20220620105953/https://github.com/NativeScript/NativeScript/blob/master/packages/core/ui/button/index.android.ts|url-status=live}}</ref>
 
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.<ref name=visualstudiomagazine20150309 /> 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.<ref name=infoworld2893706/>
 
==Notable Featuresfeatures==
 
=== Native API Reflectionreflection ===
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.<ref name=infoworld2893706/>
 
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.<ref name=visualstudiomagazine20150309 /><ref>{{Cite web|url=https://docs.nativescript.org/core-concepts/accessing-native-apis-with-javascript|title=Accessing Native APIs through JavaScript - NativeScript Docs|website=docs.nativescript.org|access-date=2016-11-21|archive-date=2016-11-24|archive-url=https://web.archive.org/web/20161124062717/http://docs.nativescript.org/core-concepts/accessing-native-apis-with-javascript|url-status=live}}</ref>
 
=== Angular Integrationintegration ===
With the launch of NativeScript 2.0, it is possible to use Angular to build cross-platform mobile applications.<ref>{{Cite web|url=https://www.nativescript.org/blog/nativescript-2.0---the-best-way-to-build-cross-platform-native-mobile-apps|title=NativeScript 2.0 - the best way to build cross-platform native mobile apps|website=NativeScript.org|access-date=2016-11-21|archive-date=2016-12-20|archive-url=https://web.archive.org/web/20161220190523/https://www.nativescript.org/blog/nativescript-2.0---the-best-way-to-build-cross-platform-native-mobile-apps|url-status=live}}</ref> Additionally, when using Angular with NativeScript you have the ability to share large chunks of code between your web and mobile apps.<ref>{{Cite web|last=Witalec|first=Sebastian|date=2018-08-24|title=Apps That Work Natively on the Web and Mobile|url=https://blog.angular.io/apps-that-work-natively-on-the-web-and-mobile-9b26852495e7|access-date=2021-08-06|website=Medium|language=en|archive-date=2022-01-03|archive-url=https://web.archive.org/web/20220103100654/https://blog.angular.io/apps-that-work-natively-on-the-web-and-mobile-9b26852495e7|url-status=live}}</ref>
 
=== Vue.js Integrationintegration ===
The [[Vue.js]] framework is supported in NativeScript via the nativescript-vue plugin.<ref name=":0" />
 
== Supporting Toolstools and Servicesservices ==
* NativeScript Sidekick is a [[graphical user interface]] that builds off of the capabilities provided by the NativeScript CLI. With Sidekick a developer can leverage app templates, cloud-based builds for iOS and Android, and publish apps to the public app stores.
* NativeScript Playground allows developers to experiment with NativeScript in a web-based environment, and preview apps on physical devices.
* NativeScript Marketplace is a curated source of NativeScript plugins, pre-built app templates, and runnable sample apps.
Line 53 ⟶ 58:
* {{Official website}}
 
{{Rich Internetweb applications}}
{{JS templating}}
{{Rich Internet applications}}
{{Application frameworks}}
{{ECMAScript}}
 
[[Category:Rich Internetweb application frameworks]]
[[Category:2014 software]]
[[Category:Software using the Apache license]]