Building Mobile Enterprise Applications : webMethods Mobile Development Help : Creating Application Logic : Common Methods to Override in the Generated Code for the Application
Common Methods to Override in the Generated Code for the Application
When you generate sources for a mobile project, Mobile Development generates a Java class named application_nameAppControllerImpl.java, where application_name is the name you assigned the application. The application_nameAppControllerImpl.java file resides in the src.package_name.ui.controller.impl package, where package_name is the package name you specified for your mobile project.
Mobile Development provides a set of methods for the controller implementation that represents the application's life-cycle. These methods are starting points for defining the custom business logic.
Method
Description
onCreateWindow()
This method is executed after the main window for the application is created. Add logic to this method if you want to customize the main window of the application.
onOrientationChange()
This method is executed when the user rotates the device and changes the device’s orientation from portrait to landscape or vice versa. Add logic to this method that you want performed when a device is rotated, for example, redisplay the user interface for the new orientation.
By default, this method updates the dimensions of the panes in the window. If you need to take further action, you can uncomment the onOrientationChange() method and add your custom logic.
onPushNotification(String message)
This method is called after a push notification has been received by the device. The passed string represents the message that has been sent with the push notification.
createSideViewController()
This method is called once the user calls getSideViewController() on the AbstractApplicationController. It will create a new SideViewController. Overwrite this method to publish your own implementation.
onPushNotification(String, Hashtable)
This method will be called after a push notification is received. It will also provide some parameters sent with the push notification.
onPushNotificationError(String)
This method will be called if a push notification results in an error.
onDeviceRegistered(String)
This method is called after the device is registered to receive push notifications.
Once the device is registered on the platforms push notification service (GCM, APNS or WPNS), a registration id is created to identify this application. This id will be send to the application, which results in calling this method. Overwrite this method to publish the registration id to Mobile Administrator.
updatePaneDimensions()
This method is called by onOrientationChange after the user has rotated the device. The default implementation tries to re-size all panes to the new dimensions. You can overwrite this method if you want to have pane dimensions other than those provided by the default implementation.
Copyright © 2007-2016 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback