站内搜索: 请输入搜索关键词
当前页面: 图书首页 > MIDP Style Guide for the Java 2 Platform, Micro Edition

MIDP Style Guide for the Java 2 Platform, Micro Edition

[ directory ] Previous Section Next Section

9.7 Alert Types

All alerts can have an associated alert type, which the application developer can provide, to give the MIDP implementation an indication of the function of the alert. An alert type is a typesafe enumeration that has the following constants: INFO, WARNING, ERROR, ALARM, and CONFIRMATION, as described in the upcoming sections.

Application Developers

Recommend: graphics/bulb2_icon.gif Give your alerts an alert type whenever possible. Associating an alert type with an alert enables your MIDlet to take advantage of any visual and auditory specialization of a MIDP implementation.

MIDP Implementors

Recommend: graphics/bulb2_icon.gif Differentiate alert types clearly to users. Do this through the use of layout, sounds, and so on. Giving the user visual and auditory cues as to the nature of an alert can make applications easier to use.

Another way to differentiate alert types is with images. (Many alerts in the upcoming figures have an image that reinforces its purpose.)

Consider: If you use images to differentiate alert types, determine and publish how they will work with any images the application provides. For example, MIDP for Palm OS had images that it used to differentiate the alert types, unless the application provided an image. If the application provided an image, it used that image instead.

9.7.1 INFO Alert Type

The INFO alert type is designed for providing nonthreatening information. In the MIDP Reference Implementation, there is no sound associated with an INFO alert. Figure 9.8 shows an INFO alert.

Figure 9.8. An Alert with an INFO Alert Type

graphics/09fig08.gif

Application Developers

Consider: Use INFO alert types to display About boxes and Splash screens.

9.7.2 WARNING Alert Types

The WARNING alert type is designed for informing the user about potentially dangerous operations. In the MIDP Reference Implementation, a WARNING alert plays a tone. Figure 9.9 shows a WARNING alert.

Figure 9.9. An Alert with a WARNING Alert Type

graphics/09fig09.gif

Application Developers

Consider: Use a WARNING alert type to let the user know about actions that might require an application to restart or that could result in data loss.

Consider: Make alerts of type WARNING modal.

9.7.3 ERROR Alert Type

The ERROR alert type is designed for showing users error messages. In the MIDP Reference Implementation, an ERROR alert plays a tone. Figure 9.10 shows an ERROR alert.

Figure 9.10. An Alert with an ERROR Alert Type

graphics/09fig10.gif

Application Developers

Consider: Application developers should consider using ERROR alert types to tell users about errors that the system cannot correct.

Strongly Recommend: graphics/bulb1_icon.gif Make alerts of type ERROR modal. If the error is severe enough to warrant interrupting the user, the user should be able to take as much time as necessary to read and understand the information. A user can keep the modal dialog open indefinitely.

9.7.4 ALARM Alert Type

The ALARM alert type is designed to alert users to events about which they had asked to be notified. In the MIDP Reference Implementation, an ALARM alert plays a tone. Figure 9.11 shows an alert with an ALARM alert type.

Figure 9.11. An Alert with an ALARM Alert Type

graphics/09fig11.gif

Application Developers

Consider: Use ALARM alert types to inform users only when they have previously requested the alert. Use this alert type in conjunction with MIDP's timer and alarm functionality.

Recommend: graphics/bulb2_icon.gif Make alerts of type ALARM modal so that you can be sure users got the information they requested.

9.7.5 CONFIRMATION Alert Type

The CONFIRMATION alert type is designed to provide information so that a user can confirm that a particular event should occur. Figure 9.12 shows an alert with a CONFIRMATION alert type.

Figure 9.12. An Alert with a CONFIRMATION Alert Type

graphics/09fig12.gif

Application Developers

Consider: Use a CONFIRMATION alert type on a modal alert to ask users to confirm operations that may cost money, use airtime, or change data. Give the alert two abstract commands (one of type OK and the other of type CANCEL; see "Abstract Commands" starting on page 165 for more information) and provide labels appropriate for the task. For example, Figure 9.12 shows an alert that allows the user to decide whether to continue with an operation that would cost money.

    [ directory ] Previous Section Next Section