During the lifecycle of an application, the mobile device usually triggers several events. The APIs in this chapter allow you to listen to these events and override them with application specific functionality.
You should register for application events during the application load event of the project or masterdataload event of the startup form. This chapter consists of the APIs with the namespace kony.application.
This API is used by the developer to invoke all initialization events such as preappinit, postappinit, init, appservice, showstartupform etc.
The application lifecycle is follows:
postappinit[params]: Is an existing event that the developer registers in the IDE per application basis. Developers use this function to define logic that needs to be executed before the first form is shown and after the application is initialized.
postappinit can return a form handle. If postappinit returns a form handle, then the platform shows the form returned from the postappinit callback, otherwise the platform invokes the showstartupform function.
appservice[params]:The closure provided against appservice will be invoked by the platform in a sequence. This function also returns the form handle.
appservice can return a form handle. If appservice returns a form handle, then the platform shows the form returned from the appservice callback. If appservice does not return a form handle, the platform invokes the showstartupform function.
If both postappinit and appservice return the form handle then, the form returned by app service is given priority by the platforms.
showstartupform[params]: This is a method invoked by the platform to show the startup form, as indicated in the IDE.
This event is invoked only when postappinit returns a nil. If appservice returns a form handle, showstartupform is not invoked.
prem | Copyright © 2012 Kony, Inc. All rights reserved. |
prem | Copyright © 2012 Kony, Inc. All rights reserved. |