Palm webOS: Developing Applications in Javascript Using the Palm Mojo Framework – Page 3
But running one application at a time, or performing one activity at a time, can be terribly restrictive, and inefficient. Palm webOS was designed to make it easy to work on more than one thing at a time. Simply pressing the Center button brings up a new view, the Card view, an example of which is shown in Figure 1-4. From the Card view, you can switch to another activity simply by scrolling to and tapping the card representing the activity. Alternately, you can launch another application from the Quick Launch bar.
The Card view was inspired by the way one handles a deck of cards. Cards can be fanned out to see what card is where. Within a deck of cards, any single card can be selected or removed with a simple gesture, or moved to a new location by slipping it between adjacent cards. The webOS Card view can be manipulated in similar ways by scrolling through the cards, selecting and flicking cards off the top to remove them or selecting and dragging a card to a new location.

We’ve introduced the term activity, which needs further explanation. Often by design, you will work on one activity at a time with many applications, but with some applications it is more natural to work on several activities in parallel. A common email activity is writing a new email, but in the middle of writing that email, you may want to return to the inbox to look up some information in another email or perhaps read an urgent mail that has just arrived.
With a webOS device, the draft email has its own card separate from the email inbox card. In fact, you can have as many draft emails, each in their own card, as you need; each is considered a separate activity and independently accessible. Switching between emails is as simple as switching between applications and your data is safe, as it is always saved. Figure 1-5 shows the Card view with the Email application’s inbox card and a draft email compose card.

What happens to the current foreground application when you switch to a new application? The previous application is not closed but continues to run as a background application. Background applications can get events, read and write data, access services, repaint themselves and are generally not restricted other than to run at a lower priority than the foreground application.
To enable background applications to communicate with the user, Palm provides a notification system with two types of notifications:
- Popup. Non-modal dialogs which are of fixed height and include at least one button to dismiss the dialog
- Banner. Non-modal icon and single non-styled string of text
Popup notifications are disruptive, appropriate for incoming phone calls, calendar alarms, navigation notifications and other time sensitive or urgent notifications. Users are forced to take action with pop-ups or explicitly clear them but since they are not modal, users are not required to respond immediately.
