O'Reilly logo

PhoneGap 4 Mobile Application Development Cookbook by Zainul Setyo Pamungkas

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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:

  1. Firstly, create a new PhoneGap project named touch by running the following line:
    phonegap create touch com.myapp.touch touch
    
  2. Add the devices platform. You can choose to use Android, iOS, or both:
    cordova platform add ios
    cordova platform add android
    
  3. Add the dialog plugin by ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required