initial source code from the Cordova sample app... to be modified