|Written by Ian Elliot|
|Tuesday, 10 March 2015|
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.
This sounds complicated, but it actually fairly straightforward. You make a full reference to the native API function, for example
and this sets up a call to the Java API function File.
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:
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%.
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.
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.
or email your comment to: email@example.com
|Last Updated ( Wednesday, 06 May 2015 )|