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.
onMessage(PushNotification notification)
This method is called after a push notification was received by the device while the app is running. If the app is not running, the onStartAppFromPushNotification(PushNotification) method is called. The passed PushNotification object contains a string (representing the message) and parameters which were sent with the push notification.
onPushNotificationError(String)
This method will be called if a push notification results in an error.
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.
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.
onStartAppFromPushNotification (PushNotification notification)
This method will be called if the app receives a push notification, but is not running. As a counterpart, onMessage(PushNotification) will be called if the app receives a push notification and is running or in the background.
onStartAppFromURL(String scheme, String url)
Will be called when the application is started from an URI scheme it is registered for. The registration needs to be defined in targets/_default_.xml. For detailed information, refer to Defining Data Sharing for an Application in the Mobile Designer documentation available in Software AG Designer via Help > Help Contents > Software AG Designer Guides > webMethods Mobile Designer Help.
onStartAppFromFile(String mimeType, String absolutePath)
Will be called when the application is started by passing a file into the application. The mime-type is provided as well as the absolute path to read the file from.
Copyright © 2007-2017 Software AG, Darmstadt, Germany.

Product LogoContact Support   |   Community   |   Feedback