Phonegap side of the app