Learn NATIVESCRIPT with Real Code Examples
Updated Nov 23, 2025
Installation Setup
Install Node.js and npm
Install NativeScript CLI: `npm install -g @nativescript/cli`
Create project: `ns create MyApp`
Add platforms: `ns platform add android ios`
Build and run: `ns run android` or `ns run ios`
Environment Setup
Install Node.js and npm
Install NativeScript CLI globally
Install platform SDKs (Android Studio, Xcode)
Configure paths and environment variables
Create and build projects with NativeScript
Config Files
package.json - npm dependencies
nsconfig.json - CLI configuration
app/ - source code
hooks/ - build automation scripts
platforms/ - platform-specific builds
Cli Commands
ns create MyApp
ns platform add android ios
ns plugin add <plugin-name>
ns build android
ns run ios
Internationalization
i18n libraries supported (ngx-translate, vue-i18n)
Text content and labels fully customizable
Supports LTR and RTL layouts
Date/number formatting via JS libraries
Localization configuration per platform
Accessibility
Leverages platform accessibility APIs
Supports screen readers and ARIA roles
Keyboard navigation and focus management
Testing required across iOS and Android
Custom accessible components encouraged
Ui Styling
Native UI components styled via CSS or framework-specific styles
Layouts adapt to different screen sizes
Supports Angular and Vue templating
Animations via native transitions or CSS
Themes can be customized per app
State Management
Handled via Angular, Vue, or JS frameworks
Plugin state maintained internally
Events manage parent-child and plugin communication
App-level state can use NgRx, Vuex, or other libraries
Integration with backend APIs for persistent state
Data Management
Local storage via plugins or native modules
Remote data via REST APIs, GraphQL, or WebSockets
Database plugins (SQLite, Couchbase) available
No built-in global state; use frameworks for complex apps
Offline caching via plugins or framework libraries