Taking the sample code from Cordova docs and turning them into working examples