BlackBerry Application Life-Cycle and Phases

The runtime lifecycle defines a common runtime architecture that is the same for all apps. This makes mobile apps much easier to design, and means that you don't have to worry about complex interactions with the system; critical system interactions are already built into the lifecycle.

BlackBerry application life-cycle

Following are the events which used in order while your application will move through.

Event Object Method
Application launched. UiApplication main( String[] args )
OS tells application to start. MainScreen activate()
Screen is pushed onto stack. MainScreen onDisplay()
Screen about to be drawn. MainScreen onUiEngineAttached()
Menu or dialog is removed. MainScreen onExposed()
Screen is closed. MainScreen close()
OS puts application in background. UiApplication deactivate()

The BlackBerry Tablet OS is a multithreaded, multitasking platform so it can run multiple applications at the same time. While your application is running in the foreground, it is active. However, it can be interrupted when another application opens and replaces yours as the active application

These events can be fire into three main phases in a BlackBerry application runtime life-cycle:

  1. Startup : startup is generally done by one of the following three ways

    - User clicks the application's icon on the home screen.

    - Application is automatically started when device is turn on.

    - The application is run by another application.
     
  2. Running
     
  3. Exiting

Thank You....