Angular2 + Electron + NativeScript


#1

Hi all! What do I need to know in order to write simple “Hello World” app which then I could easly run on Android and Windows. (How much effort it will cost ?). Thx for all advices.


#2

Electron doesn’t currently support Android. So if you’re looking for a web application framework that covers both Windows and Android out of the box, you’ll probably have to look at something else like Ionic perhaps? (Sorry, I haven’t looked too much into web frameworks for mobile lately :confused: )


#3

I’ve been working on Cordova/Electron apps, writing a JS file that maps functionality either to Node APIs or Cordova plugins, which allow me to build for both mobile platforms and desktop with a (mostly) single codebase.

Ionic v1 is based on Cordova and AngularJS with an extra layer of UI goodness, and Ionic v2 is NativeScript and Angular 2 (and optionally TypeScript).

The issue that I see with using NativeScript is its use of XML over HTML, etc, which likely means a lot of hacking around or not having a shared UI codebase, or building a library to read XML and output valid HTML and CSS (although this could be leveraged somewhat with Angular 2). It’s actually something I’ve been looking into recently, and it looks like a Electron+React/React Native app might be more feasible, but it comes down to a matter of preference, really.

In my opinion, for a single codebase with consistent styling across mobile and desktop, your best bet (or at least the most straightforward solution), would be a Cordova/Electron app with the framework and transpilers of your choice.