NativeScript

What is NativeScript?

NativeScript is an open-source framework to develop mobile apps on the Apple iOS and Android platforms. It was originally conceived and developed by Progress. At the end of 2019 responsibility for the NativeScript project was taken over by long-time Progress partner, nStudio (en.wikipedia.org). NativeScript allows scaffolding projects with various templates to kickstart your app development. Official templates can be found in the Templates GitHub repository and on NPM (docs.nativescript.org).

Learn more

Strengths & Weaknesses

Strengths

  • Native user experience: NativeScript allows developers to build mobile applications that provide a native user experience on both iOS and Android platforms.
  • Access to native APIs: NativeScript provides access to a large number of native device APIs, allowing developers to create applications with rich functionality.
  • Code reuse: NativeScript allows developers to write code once and reuse it across both iOS and Android platforms, reducing development time and costs.
  • Large developer community: NativeScript has a large and active community of developers, which means there are plenty of resources available online for learning and problem-solving.
  • Flexibility: NativeScript allows developers to use a variety of languages and frameworks, including JavaScript, TypeScript, Vue and Angular, giving them the flexibility to choose the best tools for their needs.

Weaknesses

  • Performance: NativeScript applications may not perform as well as fully native applications, especially for complex or resource-intensive applications.
  • Learning curve: While NativeScript is built on familiar web technologies like JavaScript, it may still have a learning curve for developers who are new to the framework.
  • Limited UI components: NativeScript provides a limited set of UI components out of the box, which may require developers to create custom components for their applications.
  • Dependency on third-party plugins: While NativeScript provides access to a large number of native device APIs, it may require third-party plugins for some functionality, which can add complexity and introduce compatibility issues.
  • Compatibility issues: NativeScript applications may have compatibility issues with older devices or older versions of operating systems.

Overall, NativeScript is a good choice for developers who want to create cross-platform mobile applications with a native user experience and access to native device APIs. While it may have some performance and compatibility issues, it offers a flexible and powerful development environment with a large and supportive community.

PWA Support

You can create a Progressive Web App (PWA) using NativeScript, a cross-platform framework for building mobile and web apps using Angular, React, or Vue.

Here are the basic steps to create a PWA with NativeScript:

Install NativeScript on your development machine by following the instructions on the NativeScript website.

Create a new NativeScript project by running the following command in your terminal:

ns create my-app-name --template tns-template-blank-ng This will create a new NativeScript project with an Angular-based template.

Add your HTML, CSS, and JavaScript files to the project.

Configure your PWA by adding a manifest file and registering a service worker.

Test your PWA in the browser by running the following command in your terminal:

ns run browser --env.production This will launch your PWA in a browser window, allowing you to test it as a web app.

While NativeScript is primarily designed for building native mobile apps, it also provides support for building PWAs. By using NativeScript, you can leverage the power of Angular, React, or Vue, and build a high-quality PWA that can be installed on any device and accessed from any web browser.

Category

NativeScript applications can be described as native because they use native UI components and APIs provided by the target platform, whether it is Android, iOS, or other platforms like Windows and macOS. NativeScript allows developers to write code in JavaScript, TypeScript, or Angular, which is then compiled to native code for each platform. This means that the application's UI is rendered using native components rather than web technologies, which gives it a more native look and feel.

In addition, NativeScript provides a set of cross-platform APIs that allow developers to access platform-specific features like camera, file system, and sensors. This level of access to platform-specific features ensures that NativeScript applications are able to offer a truly native experience to users on multiple platforms.

Therefore, NativeScript applications can be considered as a native approach to building multi-platform mobile and desktop applications. NativeScript leverages the power of JavaScript and Angular to deliver high-quality, performant applications with a consistent and modern UI on different platforms, while also providing access to platform-specific features.

Compilation

NativeScript uses a runtime called the NativeScript runtime to execute JavaScript code and provide a bridge between the JavaScript code and the native platform APIs and libraries.

When building a mobile app with NativeScript, the JavaScript code is compiled into native code that runs on the target platform. For iOS, NativeScript uses the Ahead of Time (AoT) compiler to convert the JavaScript code into optimized native code written in Objective-C or Swift. For Android, NativeScript uses the Just-in-Time (JIT) compiler by default to generate Java bytecode that runs on the Android Runtime (ART). Alternatively, developers can choose to use the Ahead of Time (AoT) compiler to generate optimized native code for Android as well.

In summary, NativeScript compiles JavaScript code into native code that runs on the target mobile platform using the Ahead of Time (AoT) compiler for iOS and optionally for Android, or the Just-in-Time (JIT) compiler for Android. The NativeScript runtime provides a bridge between the JavaScript code and the native platform APIs and libraries, enabling developers to build high-performance, native mobile apps using JavaScript and other web technologies.

Offline Capabilities

  • Caching: NativeScript apps can cache data locally, allowing them to access previously downloaded content without an internet connection. This can improve app performance and reduce data usage.
  • Offline data storage: NativeScript apps can use various local storage mechanisms such as SQLite, LocalStorage, or FileSystem to store and retrieve data when there is no internet connection available.
  • Service Workers: NativeScript also supports Service Workers, which are background scripts that run separately from the main app thread and can perform tasks such as fetching and caching data, even when the app is not running or the device is offline.
  • Background Sync: With the Background Sync API, NativeScript apps can periodically synchronize data with the server in the background, even when the app is not actively being used.
  • Push notifications: NativeScript apps can use push notifications to send users important updates and alerts even when the app is not running or the device is offline.

Overall, NativeScript provides various capabilities and tools to create offline-first mobile applications that provide a seamless experience for users, even when they are not connected to the internet.

Native Capabilities

Partially Native

Applications developed using NativeScript have access to a range of native capabilities, such as the device's camera, accelerometer, GPS, and more, through NativeScript APIs.

While NativeScript provides access to many native capabilities through its APIs, it may not provide access to all of the features and functionalities available on a particular mobile operating system. Additionally, there may be some performance overhead associated with using NativeScript compared to developing fully native applications. However, NativeScript still provides a powerful framework for building cross-platform mobile applications that can take advantage of many of the native capabilities of the underlying operating system.

Performance

Good

The performance of NativeScript apps can be described as good, especially when compared to other cross-platform mobile development frameworks.

NativeScript uses native components and APIs of the underlying platform (iOS or Android) to render the app, which can result in faster and more responsive performance compared to other hybrid mobile app development frameworks that use web technologies like HTML, CSS, and JavaScript.

Moreover, NativeScript provides ahead-of-time (AOT) compilation, which can further improve the performance of the app by reducing the time taken to load and run the app.

However, the performance of a NativeScript app can also be affected by several factors, such as the complexity of the app, the size of the app, the number of plugins used, and the optimization of the code. Therefore, it is important to ensure that the app is optimized and tested thoroughly to ensure good performance.

Platform Compatibility

AndroidiOS

NativeScript is a cross-platform framework for building native mobile applications using JavaScript or TypeScript. It allows developers to build apps for both Android and iOS platforms, and supports a wide range of native APIs and UI components.

NativeScript provides a single codebase that can be used to build applications for both iOS and Android, with platform-specific APIs and UI components being automatically mapped to their corresponding counterparts on each platform. This makes it easier to write code that works on both platforms, reducing development time and improving code maintainability.

NativeScript also supports the use of plugins, which provide additional functionality and access to native APIs, such as camera and location services, push notifications, and more. Plugins can be easily added to a project and are available from the NativeScript marketplace.

In summary, NativeScript is a highly compatible platform for building native mobile applications, with support for both Android and iOS platforms, as well as a wide range of native APIs and UI components.

Language Support

JavaScript/TypeScriptFrameworks - Angular/Vue/React

NativeScript supports a variety of languages including JavaScript, TypeScript, and Angular for building mobile apps for both iOS and Android platforms. Additionally, developers can also use Vue.js, React, and Angular with NativeScript. NativeScript also allows developers to write platform-specific code in NativeScript Core using JavaScript or TypeScript.

Learning Curve

Medium to High

NativeScript is a framework for building native mobile apps using web technologies such as HTML, CSS, and JavaScript. While many developers already have experience using these web technologies, NativeScript requires developers to learn some additional concepts and tools to build native apps.

NativeScript uses a different approach to UI components and layout than web technologies, which may require developers to learn new concepts and techniques. Additionally, NativeScript has its own set of tools and commands, which can take some time to get used to.

Moreover, NativeScript requires developers to have some knowledge of native development, such as iOS or Android development, in order to access native features and functionality. This can add to the learning curve for developers who are new to native development.

Additionally, while NativeScript's documentation is extensive and helpful, some developers may find it difficult to navigate due to its size and complexity.

Overall, the learning curve of NativeScript is medium to high, especially for developers who are not familiar with native development or the framework's approach to UI components and layout. However, NativeScript does have a lot of resources available to help developers get up to speed, and its community is very active and supportive.

Development Time and cost

Time

Medium to High

NativeScript is a cross-platform mobile development framework that allows developers to write a single codebase for both iOS and Android platforms. This approach saves development time and costs by avoiding the need for separate codebases, and by leveraging existing web technologies like JavaScript, CSS, and HTML, which can make it easier for developers to quickly learn and build mobile apps. Additionally, NativeScript supports hot module replacement, enabling developers to see changes in real-time without rebuilding the entire app, which further speeds up the development process.

Cost

Medium to High

The development time and cost of NativeScript can vary depending on the complexity of the app, the experience of the developers, and the resources available. However, NativeScript has features that can make development more cost-effective, such as code sharing between iOS and Android platforms, which avoids the need for separate code bases. Additionally, NativeScript has a growing community that provides a variety of plugins, templates, and other resources that can help streamline development and reduce costs. Overall, NativeScript is a compelling option for mobile app development that can lead to a faster development time and lower overall costs compared to developing native apps separately for each platform.

Support & Maintenance

NativeScript is an open-source framework developed and maintained by Progress Software, which provides regular updates and support for the technology. Progress Software releases new versions of NativeScript regularly, with bug fixes, performance improvements, and new features.

In addition, NativeScript has a relatively large and active community of developers who contribute to its development and provide support for the technology. This community includes developers who create plugins and extensions to enhance the functionality of NativeScript, as well as those who participate in online forums and user groups to share knowledge and provide assistance to other developers.

NativeScript provides a range of tools and features that make it relatively easy for developers to make updates and changes to their apps. For example, NativeScript allows developers to use a single codebase to create native apps for both iOS and Android platforms, which can save time and effort.

However, some aspects of NativeScript development can be complex, particularly for developers who are new to the platform. For example, setting up and configuring the development environment, managing dependencies, and working with native modules can be challenging.

Overall, NativeScript provides good support and maintenance options, with regular updates and a relatively large and active community of developers. The ease of making updates and changes to the app is good, with a range of tools and features available, although some aspects of development can be complex, particularly for newcomers to the platform.

Developer Availability

South Africa has a well-developed software industry with a growing community of software developers. Many universities, technical colleges, and training programs offer courses and training in mobile app development, including NativeScript app development. Additionally, there are several online resources and communities for NativeScript developers that are accessible from anywhere in the world, which can help developers in South Africa to improve their skills and stay up to date with the latest trends and technologies in NativeScript development.

While the pool of NativeScript developers in South Africa may not be as large or established as in some other regions, there is still a considerable number of developers with NativeScript experience in the country. Additionally, with the continued popularity of NativeScript as a cross-platform mobile development framework, it is likely that more developers in South Africa will become proficient in the technology over time.

Overall, the availability of NativeScript developers in South Africa is likely to increase in the future, but it is currently at an "Average" level. Nonetheless, there are still opportunities to find skilled and experienced NativeScript developers in the country.

Scalability

NativeScript is a mobile app development platform that is highly scalable due to its reusable and modular code architecture. It supports a variety of plugins and libraries, allowing developers to easily add features and functionality to their applications. NativeScript's performance can be optimized through features like Ahead of Time (AOT) compilation and its efficient rendering engine. This makes it a solid choice for building scalable and high-performance mobile applications with native UI and performance. Additionally, NativeScript supports popular frameworks like Angular, Vue.js, and React, which increases the potential pool of developers available for building and scaling applications.

UX & Design

NativeScript offers the ability to customize user experience and design with CSS and leverage native platform capabilities such as animations, gestures, and UI components. The framework also provides a large number of plugins for extending functionality and integrating with third-party services. NativeScript is designed to provide flexibility for creating beautiful and intuitive user experiences while utilizing native platform capabilities. The framework offers tools and features for designers to create consistent and visually appealing interfaces across different parts of the application, including pre-built UI components, themes, and design frameworks. Overall, the design experience with NativeScript depends on the specific needs of the application and the skill and experience of designers and developers involved.

Security

NativeScript has several built-in security features that can help developers create secure apps, such as:

  • Secure communication: NativeScript provides support for HTTPS and SSL/TLS encryption to secure communication between the app and the backend servers.
  • Data protection: NativeScript offers various techniques to protect sensitive data, such as user authentication and authorization, data encryption, and secure storage.
  • Code obfuscation: NativeScript can obfuscate code to make it more difficult for hackers to reverse-engineer and understand the app's logic.

However, the security of NativeScript apps ultimately depends on how the app is designed and developed. Developers must follow best practices and use secure coding techniques to ensure their apps are secure.

CSS & Styling

You can style NativeScript applications using CSS, which is a standard styling language for web and mobile applications. NativeScript uses a subset of CSS that is compatible with CSS3 and includes some additional features that are specific to NativeScript.

To style a NativeScript application, you can create a separate CSS file or include the styles within your XML layout files using the style attribute. Here are some tips for styling NativeScript applications:

  • Use class selectors: You can apply styles to multiple elements at once by using class selectors. You can define a class in your CSS file and apply it to elements in your XML layout file using the class attribute.
  • Use element selectors: You can apply styles to specific elements using element selectors. For example, you can apply styles to all Label elements in your app using the Label selector in your CSS file.
  • Use ID selectors sparingly: While you can use ID selectors to apply styles to specific elements, it is generally not recommended as it can make your CSS less reusable.
  • Use layout containers: NativeScript provides a variety of layout containers, such as StackLayout, GridLayout, and FlexboxLayout, which can help you structure your app and apply styles to groups of elements.
  • Use CSS variables: NativeScript supports CSS variables, which allow you to define reusable values that can be used throughout your CSS file.