NativeScript is an open-source framework for building truly native mobile applications using JavaScript, TypeScript, Angular, Vue, React, or Svelte. Unlike hybrid frameworks that rely on WebViews, NativeScript provides direct access to native iOS and Android APIs at runtime, rendering native UI components for authentic platform experiences. It combines the productivity of web technologies with the performance and capabilities of native development, making it ideal for teams wanting to leverage existing JavaScript skills while delivering platform-specific features. A key advantage is the ability to share code across platforms while still accessing platform-specific APIs when needed, and the rich plugin ecosystem extends functionality without compromising on native performance.
What This Cheat Sheet Covers
This topic spans 15 focused tables and 103 indexed concepts. Below is a complete table-by-table outline of this topic, spanning foundational concepts through advanced details.
Table 1: Core Architecture and Platform API Access
| Concept | Example | Description |
|---|---|---|
const view = new android.widget.TextView(context);const button = new UIButton(context); | • Access iOS and Android APIs directly from JavaScript with full type support • no bridge layers or performance overhead | |
const file = java.io.File.new("/path/file.txt");const color = UIColor.redColor(); | • Automatic conversion between JavaScript and native types at runtime • primitives, objects, and callbacks seamlessly translated | |
if (global.isIOS) { }if (global.isAndroid) { } | • Conditional execution based on platform • use .ios.ts and .android.ts file extensions for complete separation | |
import { Application } from '@nativescript/core';Application.run({ moduleName: 'app-root' }); | Cross-platform abstractions for common platform features like file system, HTTP, connectivity, and device info |