Event listeners

Event listener interfaces are divided by event type. Each application registers to receive specific types of events. The application event queue then dispatches events to the appropriate listeners.

Applications can implement the appropriate listener interfaces or override the listener methods on the various Screen objects. Most applications implement the KeyListener and TrackwheelListener interfaces and register the listeners to receive keyboard and trackwheel events. The keyboard and trackwheel are the primary means by which users interact with applications.

The following event listeners are located in the net.rim.device.api.system package:

Listener interface

Type of event

AlertListener

Implement this interface to listen for alert events.

BluetoothSerialPortListener

Implement this interface to listen for Bluetooth serial port events, such as the opening of a Bluetooth serial port connection either as a server or client.

GlobalEventListener

Implement this interface to listen for global events that are broadcast to all applications.

HolsterListener

Implement this interface to listen for holster events, such as the insertion or removal of the BlackBerry device from the holster.

IOPortListener

Implement this interface to listen for I/O port events.

KeyListene r

Implement this interface to listen for keyboard events, such as the user pressing or releasing a key.

RealTimeClockListener

Implement this interface to listen for real-time clock events, such as the clock being updated.

SerialPortListener

Implement this interface to listen for serial port events, such as a change in the status of data being sent to the serial port connection, for BlackBerry devices that are connected to the computer serial port.

SystemListener

Implement this interface to listen for system events, such as changes to battery status and power.

TrackwheelListener

Implement this interface to listen for trackwheel events, such as the clicking of the trackwheel.

USBPortListener

Implement this interface to listen for USB port events, such as the status of data being sent to the USB port connection, for BlackBerry devices that are connected to the computer USB port.

0 0

Post a comment

  • Receive news updates via email from this site