Code for the phonegap lectures