using phonegap events