News

Telerik's NativeScript Aims To Centralize Cross-Platform Mobile Development

Now in beta testing, the new framework offering takes an open source JavaScript-based approach to cross-platform coding across iOS, Android and Windows with one code base.

Telerik has opened up to public beta testing its NativeScript framework. The new offering takes an open source JavaScript-based approach to cross-platform coding across iOS, Android and Windows with one code base.

The NativeScript approach provides access to platform-specific APIs through JavaScript calls, using the native platform's rendering engine to interpret the code.

Telerik, a subsidiary of Progress Software Corp., is open sourcing the NativeScript platform for use by all developers free of charge, but it's tailored to work within the company's commercial AppBuilder IDE (formerly called Icenium), part of the Telerik Platform ecosystem.

The company introduced the emergent NativeScript beta in a Web event that it claimed was attended by more than 5,000 viewers.

"This keynote changes everything we know about mobile app development," said program manager Ruslan Mursalzade in the Web event.

First announced nine months ago, NativeScript is aiming for the elusive cross-platform nirvana of writing one store-ready app that provides full native functionality and "look-and-feel" on different OSes. However, it doesn't use the WebKit rendering engine featured in several other approaches, and differs significantly from alternatives such as that used by the Apache Cordova/PhoneGap camp and the Xamarin/Appcelerator approach.

"PhoneGap framework is using the browser's layout and rendering engine to display the UI of the application," the project's FAQ states. "NativeScript is using the native platform default rendering and layout engine to display the UI of the application."

It also points out several perceived advantages over the Xamarin/Appcelerator model, such as support for third-party libraries without the need for wrappers. "This is not the case in either Appcelerator or Xamarin," Telerik states. Also, the FAQ says, shared UI across platforms "is currently not supported in Xamarin and has significant productivity value when building medium and large mobile applications targeting more than one OS."

In the Webcast, Telerik developers explained how they chose to use common and accessible Web technologies for their cross-platform approach, leveraging standards-based JavaScript, along with standards-based CSS for styling.

Product manager Valio Stoychev said his favorite part of the NativeScript project was the library support, a feature also highly touted by coders taking part in the NativeScript Insiders beta experience. "We provide you with support for third-party native libraries out of the box," Stoychev said. "This is a huge thing. You'll be able to use any native Java or Objective-C library in your NativeScript project."

While NativeScript aims to provide full code reuse for most situations, Telerik acknowledges some projects might require writing native code. "The answer to how NativeScript invokes native code again lies in the JavaScript VM APIs," said developer evangelist TJ Van Toll in a February blog post explaining How NativeScript Works. He explained how to use a series of callbacks to execute C++ code at certain times while executing JavaScript, for example.

Telerik explained in a short video how the NativeScript Modules Layer handles the translation of API calls. "The JavaScript call doesn't get compiled, but instead it is interpreted at run time," the narrator said. "There is no need for any wrappers to access native APIs, and as a result, there are no limits in terms of which native API functions your app can call. This is the foundation of the NativeScript framework. At this level, all API calls are platform-specific, which requires your app to have separate code to call Android, iOS and Windows Phone. However, this doesn't mean that you have to write the code for each platform yourself. The framework comes with a platform-agnostic abstraction layer called the NativeScript Modules Layer. You don't need to think about how to perform the same operation using three different platform APIs. Instead, you can concentrate on the 'what' and not 'how.' "

Mursalzade's bold claim that NativeScript "changes everything" about mobile development brought comparisons to another JavaScript-based approach recently unveiled that led many to invoke similar game-changing accolades: the upcoming React Native project resulting from a Facebook/Instagram collaboration based on the React JavaScript Web technology.

Both projects use Web-based technologies but eschew the clumsy DOM used in HTML development in favor of hooking into native code with the JavaScript translation approach. One key difference is that while NativeScript is a traditional cross-platform, "write once, run anywhere" approach, React Native turns that around to a "learn once, write anywhere" philosophy in which developers use the same language to write separate native apps.

"Similar in implementation to React Native," read one commenter on a Reddit thread about NativeScript. "It uses a JS engine to talk to native APIs. With React Native you will still end up writing different frontend/rendering/layout code for each platform, however."

NativeScript is now available on GitHub. According to the company's roadmap, NativeScript v1.0 is planned for a May introduction, featuring a style guide for building cross-platform apps, Android performance improvements, new cross-platform UI elements and numerous other enhancements. The company is hosting a three-day TelerikNEXT conference in Boston starting May 3.

"I believe the NativeScript framework is going to revolutionize the mobile application marketplace," the company quoted Sharesoft exec Ian Price as saying. "Building mobile apps from a single code base enables developers to reuse features and functionality across platforms, which simplifies mobile app development and significantly increases productivity. I'm also impressed by how easily I've been able to develop native, cross-platform applications using familiar Web development tools and skills."

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube