Working with touch and gesture events
When working with user interfaces that demand a high level of user interaction or certain processes to be run at certain moments, we need to consider using events and detecting them to execute methods. In this recipe, we will create some functionality that will demonstrate not only the setting of an event but also its removal.
How to do it...
We will use the methods available in the XUI library to control the delegation of event handlers:
Firstly, create a new PhoneGap project named
touch
by running the following line:phonegap create touch com.myapp.touch touch
Add the devices platform. You can choose to use Android, iOS, or both:
cordova platform add ios cordova platform add android
Add the dialog plugin by running this line:
cordova plugin add org.apache.cordova.dialogs
Open
www/index.html
and clean up the unnecessary elements. Include a reference to the XUI JavaScript library and the Cordova JavaScript file.Add an empty
script
tag block before the closing...