An app has various states that it can be in while it runs on the BlackBerry 10 device. You need to understand and shape your app accordingly to respond to these states.
Because BlackBerry 10 is a multi-tasking OS, your app is expected to behave appropriately while other apps are also running on the device. Nothing is more frustrating for users than when an app doesn’t behave the way it is expected. These are examples of unexpected behaviors: not pausing correctly when minimized, continuing to play audio when it shouldn’t and/or making other apps sluggish by taking up a lot of memory. Therefore, you need to take the given app/window states and utilize it accordingly to the functionalities given by the navigator in the Blackberry Platform Service library.
The state of your app undergoes transition when given a navigator event. The two simplest events are NAVIGATOR_WINDOW_ACTIVE and NAVIGATOR_WINDOW_INACTIVE which determine the activity of the app. The NAVIGATOR_WINDOW_ACTIVE is given when launching the app or bringing the app back to the foreground. In this state, the app should be active, interacting with the user. Your app shouldn’t be doing any work when the NAVIGATOR_WINDOW_INACTIVE is received. The exception to this practice is when your app has the permission to run_when_backgrounded.
While the two activity states do divide the entire app life cycle into two distinct parts, there are other specific states which undergo transitions. Therefore, it is important that you handle the various states and respond to each event in your app.