Code from a phonegap workshop