Using gestures

The Gesture API allows MIDlets to receive notifications when the user interacts with Canvas or CustomItem elements. The API registers touch interaction as a series of gesture events.

You can combine the Gesture API with the Frame Animator API to create linear drag and kinetic scroll animations. You can also use gesture events together with traditional pointer events and multipoint touch events to implement more complex touch functionality.

API contents

The Gesture API consists of the following classes and interfaces (packaged as part of the Nokia UI API):

  • GestureEvent

    Use the GestureEvent interface to retrieve information about a gesture event. A GestureEvent object returned by the platform represents a single gesture event of a given type.

  • GestureInteractiveZone

    Use the GestureInteractiveZone class to define the touchable screen area and which types of gesture events are received from this area.

  • GestureListener

    Use the GestureListener interface to implement a listener for receiving a notification whenever a gesture event occurs.

  • GestureRegistrationManager

    Use the GestureRegistrationManager class to manage GestureInteractiveZones and GestureListeners.

The Gesture API is supported since Nokia UI API 1.1b.

Device compatibility

The Gesture API is supported since Series 40 6th Edition FP1.

Implementing touch functionality

To implement touch functionality in your MIDlet:

  1. Set the MIDlet to receive gesture events

  2. Define the handling of gesture events in the MIDlet

For more information about the Gesture API classes and methods, see the Gesture API reference.