NativeScript is a system that allows you to write native apps for Android, iOS and Windows Phone using JavaScript - and no this isn't a wrapper for an HTML app.
You may have encountered frameworks like PhoneGap/Cordova that enable you to run Web apps as if they were native apps, but NativeScript follows Microsoft's approach - you can use different languages and even markup to create true native apps. At the moment Android is mainly Java and iOS is mainly Objective C/Swift.
NativeScript is standard JavaScript that has been extended with some clever middleware that allows you to call functions in the native API.
This sounds complicated, but it actually fairly straightforward. You make a full reference to the native API function, for example
var file=new java.io.File(path);
and this sets up a call to the Java API function File.
The clever part is that the JavaScript string that specifies the path is automatically converted to a java.lang.String object for the call. The Java File object as attached to the JavaScript variable file in the sense that any attempt to access properties on file are passed on to the Java File object. That is, file acts as a proxy for File.
The JavaScript is interpreted using the standard JavaScript engine V8 for Android and webkit for iOS and Windows Phone. Notice, however, that no wrapper is used - there is no browser component building the UI for you from HTML. If you want a button then you have to write JavaScript that calls the native class constructor.
At this point you may start to think that this is great but wait - I still have to write three versions of my app. One using Android native calls, one using iOS native calls and one using Windows Phone native calls. This means your only advantage is that you can make use of JavaScript for all three and this is possibly a language you know. The advantage of using a wrapper is that you are essentially writing a web app, i.e something that could run in a browser, and then using a wrapper that is essentially a modified browser to make it look a bit like a native app.
NativeScript can help you write just one app for all three platforms using a set of abstractions by way of the NativeScript Modules layer that map onto the native APIs. So instead of specifically calling the API function for File you can simply write:
var file=File(path);
and the abstraction layer will map the JavaScript to the correct native call.
The danger with adopting any scheme like the NativeScript Modules is that making any such abstractions complete is difficult and this means that there are always things you cannot do. In the case of NativeScript this isn't such a worry because you can always fall back on direct API calls.
[フレーム]
The NativeScript system is built on Node.js and to use it you still need to install parts of the native system you are working with - XCode, for example. So you still need some skill in using the native SDKs.
You might also be worried about the overheads in using all of these translations between systems, but it is clamed that it only slows things down by about 10%.
NativeScript has been developed by Telerik, known for its wrapper approach to developing "native" apps with JavaScript. The surprise is that NativeScript is open source under the Apache 2.0 licence. Presumably Telerik hopes to make a profit on supplying extras such as Telerik Platform Services
If this can be made to work, and if the performance loss is only about 10% as claimed, then this is a useful alternative way of creating native apps. It is hoped that a Version 1 will ship in April.
More Information
Related Articles
How Google Does Multi-Platform In Inbox
Microsoft's WinJS - New Cross-Platform Library
marin 3.0 Released With Xamarin Designer for iOS and Xamarin.Forms
To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin, or sign up for our weekly newsletter.
Blockly Moving To Raspberry Pi Foundation
31/10/2025
Blockly is moving to a new home. Having originated as a single-person project at Google in 2011, it is now a vibrant open source project which has moved into robotics as well as being at the heart of [ ... ]
Codacy Provides Free AI- Risk Assessment
05/11/2025
Codeacy has launched a free benchmarking survey to help engineering teams measure the risk profile of their AI coding workflows when using tools like GitHub Copilot, Cursor, or Claude and co [ ... ]
- GitHub Copilot CLI And Spaces In Preview
- Julia 1.12 Adds Trim Feature
- Missing The Point Of LLMs
- George Boole, Boolean Logic and Computing
- Google Tunix Hack Hackathon Now Open
- OpenCode - The Claude Code Alternative
- Linkerd Adds MCP Support
- The Fuss About Fil-C...
- IBM Launches Granite Version 4.0 and Granite-Docling
- What Does JetBrains Survey Tell Us About AI
- Eclipse Foundation Adds Agentic Functionality To Eclipse LMOS
- Europe Gets Its Own LLM
- GitHub Announces Agent HQ Organizer
Comments
or email your comment to: comments@i-programmer.info