How to reuse JavaScript in a variety of environments

Written by NickWal

By many accounts, JavaScript really has become a universal scripting language. This is, in large part, is thanks to the v8 JavaScript engine originally developed for the Google Chrome browser and then extracted to run as a separate engine on a server or on the desktop without the browser.

Added to that you also have Apache Cordova which allows you to run a web application inside the phone.

There are a number of benefits to this for especially for developers. A developer can write a lot of business logic and to run directly on the developers desktop, greatly facilitating testing and debugging. Then by adding various layers of wrapping its possible to eventually create a web application and then finally a mobile application.

What you will learn

This set of tutorials will demonstrate step by step how to build a simple mobile phone application from scratch - and it will do it without making use of boilerplate generating applications such as Yeoman (another way of getting up to speed quickly).

Each part of the application uses exactly the same core service for querying bitcoin price information over the web.

Part 1 : A command line tool for querying bitcoin price information
Part 2 : A simple web application for querying bitcoin price information
Part 3 : An extremely basic android application for querying bitcoin price information
Part 4 : An extremely basic android widget for querying bitcoin price information
Part 5 : Where else can we get this to run, Windows UWP applications on a raspberry pi?

What will you be able to do

When you have finished this set of tutorials you will have an understanding of some programming techniques which let you write multiplatform code. You will have learned some good practices such as separating application logic from display logic, and seen one way of running tests with npm. You will see the basic elements of how to write code for different environments available from node.