Write Once, Ship Everywhere

Writing a new mobile app? The first question you should ask yourself is: what platform are you going to build on?

The platform whose users spend the most amount of money on apps (iOS)[^n]?

The platform with the most market share (Android)[^n]?

The platform that most enterprises/personal machines are running (Windows/Windows Phone)[^n]?

What about all the other players? Blackberry? FireOS? Tizen?

Sure, you could learn the development languages, tools, and design paradigms for each of these platforms but why not write once, ship everwhere with Apache Cordova.

Apache Cordova

Apache Cordova is an open source framework (read: free) for developing natively installed mobile apps. One of the overarching goals of Cordova is 100% shared code which is achieved by writing in the one framework that works everywhere: the web (HTML/JavaScript/CSS). Cordova packages the HTML-based application to a native application shell (which can be installed via the native app stores for the various platforms) and renders the web app in what is effectively a webview.

In comparison with other native/hybrid development frameworks:

Plugins

With your app written in HTML/JavaScript/CSS, how exactly do you access native capabilities like the camera, accelerometer, etc? Well, with plugins!

Plugins abstract native implementations exposing a common JS api. Here's what the code would look like: