Content deleted Content added
Expanding bare references using ReferenceExpander |
|||
Line 15:
}}
'''NativeScript''' is an [[open-source software|open-source]] framework to develop [[mobile app]]s on the [[iOS|Apple iOS]] and [[Android (operating system)|Android]] platforms. It was originally conceived and developed by Progress.<ref>{{Cite web|url=https://www.infoq.com/news/2015/03/nativescript/|title=Creating Mobile Native Apps in JavaScript with NativeScript|website=InfoQ}}</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}}</ref> responsibility for the NativeScript project was taken over by long-time Progress partner,
==Development==
Line 24:
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>{{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}}</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/|title=Frequently asked questions about NativeScript|website=NativeScript.org}}</ref>
==Direct
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}}</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>https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/ui/button/button.ios.ts</ref> or com.android.widget.Button on Android.<ref>https://github.com/NativeScript/NativeScript/blob/master/tns-core-modules/ui/button/button.android.ts</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
=== Native API
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}}</ref>
=== Angular
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}}</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}}</ref>
=== Vue.js
The Vue.js framework is supported in NativeScript via the nativescript-vue plugin.<ref name=":0" />
|