You can generate UI events programmatically by using the EventInjector class and its inner classes. On BlackBerry® devices that run BlackBerry® Device Software version 5.0 or later and have touch screens, you can inject touch events such as swipes and taps. You can use one of the EventInjector inner classes to model an event and you can use the invokeEvent() method to inject the event. The event is sent to the application that is currently selected and ready to accept input.
You can use event injection to automate testing. You can also use event injection to provide a way for peripherals to interact with a BlackBerry device. You can also use it in accessible applications such as speech-to-text converters. For a sample application that demonstrates event injection, visit www.blackberry.com/go/toucheventinjectorsampleapp to download the Touch Event Injector sample application. For more information about the sample application, visit www.blackberry.com/go/docs/developers to read the Touch Event Injector Sample Application Overview.