ArticleslgStudy

computer science

NativeScript

NativeScript is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand NativeScript rather than just read about it. In short: NativeScript is a JavaScript-based cross-platform open-source development framework to develop apps for iOS, visionOS and 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, Kotlin, Objective-C, and Java).

Key takeaways

  • NativeScript belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect NativeScript to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of NativeScript from memory before moving on to harder problems.

Reference excerpt

NativeScript is a JavaScript-based cross-platform open-source development framework to develop apps for iOS, visionOS and 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, Kotlin, Objective-C, and Java). It was originally conceived and developed by Bulgarian company Telerik, later acquired by Progress Software. At the end of 2019 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. NativeScript apps are built using JavaScript, or by using any programming language that transpiles to JavaScript, such as TypeScript. NativeScript supports the Angular and Vue.js JavaScript frameworks. 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. Additionally, software developers can re-purpose third-party libraries from CocoaPods, Maven, and npm.js in their mobile applications without the need for wrappers.

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

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. 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. Progress aims for a ratio of 90% common code between the iOS and Android platforms.

Direct access to native platform APIs and controls Platform-independent user interfaces are defined using XML files. 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 or com.android.widget.Button on Android. 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. 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.

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. 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.

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

Vue.js integration The Vue.js framework is supported in NativeScript via the nativescript-vue plugin.

Supporting tools and services 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.

See also List of open-source application frameworks

References

External links

Official website

Worked examples

Example 1 — a first encounter with NativeScript

Start with the simplest possible case. Write down what NativeScript claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to NativeScript before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about NativeScript ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of NativeScript

In research
NativeScript appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses NativeScript in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
NativeScript is common in secondary-school and first-year university syllabi. It links to neighbouring topics 2014 software, Mobile software programming tools, Rich web application frameworks, so understanding it makes those chapters shorter.
In everyday life
Look for NativeScript outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “NativeScript” →

How to study NativeScript in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what NativeScript means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain NativeScript out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is NativeScript in simple terms?

NativeScript is a JavaScript-based cross-platform open-source development framework to develop apps for iOS, visionOS and 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 p…

Why does NativeScript matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study NativeScript?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on NativeScript.

Tags

  • 2014 software
  • Mobile software programming tools
  • Rich web application frameworks
  • Software using the Apache license

Keep exploring