When you create an app in Telerik Platform, you need to choose between hybrid development with Apache Cordova and NativeScript development. Both approaches are cross-platform and build apps for multiple mobile platforms from the same source code. How to make the right choice?
- Hybrid: The Breakdown
- NativeScript: The Breakdown
- See Also
The term hybrid development reflects the nature of this approach—it combines the best characteristics of native and web development. A hybrid mobile app developed with Apache Cordova is basically web code running inside a native webview and wrapped as a native app. Such apps carry more web characteristics than native ones. Typically, hybrid apps have a consistent, responsive web-like user interface and browser-like performance across platforms. Contrary to web apps, hybrid apps can access some native capabilities of the device such as the accelerometer and compass sensors, the camera, the geolocation features and others.
The hybrid approach provides multiple benefits.
- Cross-platform approach: You write one codebase and then build it for for iOS, Android or Windows Phone.
- Almost complete code reuse: You can easily transform your web app into a mobile app for iOS, Android or Windows Phone.
- Reduced development time and cost: Because of the extensive code reuse and the short learning curve, you can quickly reach the production-ready stage of app development.
- Responsive and consistent user interface across platforms and devices: The web-based user interface ensures responsive behavior and consistent look and feel across all your target platforms.
- Established development ecosystem with multiple resources: Apache Cordova is a mature open-source framework with great flexibility. The core framework provides access to a limited number of native capabilities but the community has developed a wide range of custom plug-ins to tap into additional device functionalities.
- Ability to push minor app updates to your users without republishing the entire app: The major mobile platforms allow minor updates to content over the air, as long as these updates do not add or remove contents in the application package and do not modify the original purpose of the app. The Apache Cordova ecosystem already provides a number of services which let you publish such updates to Apache Cordova-based apps. One of these is Telerik AppManager LiveSync.
Both webviews and Apache Cordova pose a few development challenges for hybrid development.
- Differences in behavior and performance across devices: Because webviews differ from platform to platform and even from platform version to platform version, you might need to apply additional tweaks and optimizations to your code to ensure that your app runs as expected on all devices.
- Performance issues with heavy graphics and transitions: Webviews have some issues when processing demanding graphics and transitions (typical of games and other UI-heavy apps).
- Additional development required for platform-specific user interface or features: To tap into unique platform features, you usually need to write additional code or use a plug-in. In some cases, you might need to create the plug-in yourself.
- Limited maintenance for custom plug-ins: In many cases, although you might be able to find a plug-in for the feature that you want to implement, this module might be outdated and might require additional development. The Telerik Verified Plugins Marketplace aims to remedy this issue.
- Slow adoption of new platform versions: When a new mobile platform version becomes available, you need to wait up to a few months before Apache Cordova introduces verified support for the new version and its features.
Source: NativeScript Documentation
The NativeScript approach provides multiple benefits.
- Cross-platform approach: Most often, you can write one codebase and then build it for iOS or Android. In some cases, when you want to implement platform-specific functionality, you can quickly tweak your code.
- Native user interface and performance across platforms and devices: Because your apps use native components, they look and behave natively on iOS and Android. If you take advantage of the iOS and Android runtimes, you can even implement unique platform features with minimum effort.
- Quick access to native libraries: NativeScript provides out-of-the-box support for native libraries, including CocoaPods and Gradle.
- Open-source development ecosystem: You can shape the present and future of the framework. The NativeScript team accepts feedback and feature requests and greatly welcomes contributions.
- Day One support for new versions of the platforms: When a new mobile platform version becomes available, the NativeScript quickly provides support for the new version and its features.
- Ability to push minor app updates to your users without republishing the entire app: The major mobile platforms allow minor updates to content over the air, as long as these updates do not add or remove contents in the application package and do not modify the original purpose of the app. Telerik Platform provides the Telerik AppManager LiveSync service which lets you publish such updates to NativeScript-based apps.
The main challenge that the NativeScript framework poses is its relatively young age. The community is growing fast but the resources of the ecosystem in terms of additional plug-ins are still limited.
|Required skills and knowledge||
|Supported devices and platforms||
|User interface||Based on web components, relatively consistent across platforms||Based on native components, unique across platforms|
|Telerik Platform services|
|Supported package managers||Bower||npm|
|Extensibility model||Apache Cordova plugins||NativeScript plugins|
Hybrid development with Apache Cordova and cross-platform development with NativeScript share much in common.
- Both frameworks provide extensive code reuse—one source code compiles to apps for various mobile platforms.
- Both frameworks are first-class citizens in Telerik Platform.
- Both frameworks are flexible and can be extended by third-party plug-ins and modules.
- Both frameworks are open-source and accept contributions.
The hybrid approach is the better choice for you in the following cases.
- You want to benefit from an established framework and ecosystem.
- You want to develop your user interface with Kendo UI or jQuery Mobile.
- You want to develop your app using Bower packages.
- You want to reuse your code for an identical web app.
- You have very tight development deadlines and require a shorter learning curve.
- Your app must run on Android, iOS and Windows Phone.
- Your app must run on older and newer devices and operating systems alike.
- Your app does not require access to many native capabilities of the device.
- Your app does not rely on top performance. For example: a productivity app.
- Your app does not rely on consistent user experience and performance across devices.
- Your app does not rely on platform-specific functionality and user interface.
NativeScript is the better choice for you in the following cases.
- You want to become an early adopter and contribute to the ecosystem.
- You want to develop your user interface with Telerik UI for NativeScript.
- You want to develop your app using npm packages.
- You have sufficient time for learning and development.
- Your app must run only on Android and iOS.
- Your app must run only on newer devices and operating systems.
- Your app requires access to many native capabilities.
- Your app relies on top performance. For example: a game.
- Your app relies on consistent user experience and performance across devices.
- Your app relies on platform-specific functionality and user interface.
- Hybrid Development
- NativeScript Development
- How NativeScript Works?
- More NativeScript Questions Answered
- Introduction to NativeScript
- Getting Started with NativeScript
- Introduction to the NativeScript iOS Runtime
- Introduction to the NativeScript Android Runtime
- Introduction to the NativeScript Modules
- Building Apps with NativeScript and Angular 2