code from the phonegap conference