Previous Page Table of Contents Index Next Page

Palm OS Programmer's Companion


Palm Logo 2 Good Design Practices

This chapter helps you design an application that's fast, robust, and consistent with other applications on the device. The previous chapter described at a very high level the sorts of issues involved with writing a Palm OS® application. This chapter goes into much more detail about what is appropriate application design and user interface design. Its focus is how to:

The information was collected from engineers, testers, and other experts who designed, developed, and tested the four applications shipped with the first Palm OS device.

Paying attention to user interface guidelines and, if applicable, to localization guidelines early in your development cycle will save you time and trouble later. However, there's a lot to digest here. You may want to revisit this chapter from time to time to make sure you haven't forgotten anything.

This chapter discusses these topics:

Designing Your Application

This section provides Palm OS application design guidelines. It discusses these topics:

Integrating Programs With the Palm OS Environment

When users work with a Palm OS application, they expect to be able to switch to other applications, have access to Graffiti® and the on-screen keyboard, access information with the global find, receive alarms, and so on. Your application will integrate well with others if you follow the guidelines in this section. Integrate with the system software as follows:

In addition, follow these rules:

Naming Conventions

The following conventions are used throughout the Palm OS API:

enum formObjects {
    frmFieldObj,
    frmControlObj,
    frmListObj,
    frmTableObj,
    frmBitmapObj,
    frmLineObj,
    frmFrameObj,
    frmRectangleObj,
    frmLabelObj,
    frmTitleObj,
    frmPopupObj,
    frmGraffitiStateObj,
    frmGadgetObj};
    typedef enum formObjects FormObjectKind;

Achieving Optimum Performance

Because the Palm OS device has limited heap space and storage, optimization is critical. The Palm OS device currently has no wait cursor, so users will expect rapid response. Test for performance. Launching, switching, and finding should be fast.

To make your application as fast and efficient as possible, optimize for heap space first, speed second, code size third.

Follow these guidelines to optimize memory use:

Assigning a Creator ID

Each Palm OS application has a distinct creator ID. A creator ID is a 4-byte value used to tie together all the databases related to the application.

Creator IDs are unique to the application, not the creator of the application. Each database on the Palm device has an application value and a type. The type value should be set to sysFileTApplication for the executable's database and can be set to any value for other databases associated with an application.

Creator IDs need to be either all caps or mixed case. The Palm OS creator IDs differ from the creator ID and type that appear in the CodeWarrior Project Settings dialog boxes.

The creator ID for a Palm OS application is assigned in the PalmRez Project Settings panel.

http://www.palmos.com/dev/crid/cridsub.html

The system uses the creator ID in various ways:

  • Creator ID and type is used by the system launcher window to determine which databases are applications that should be displayed for selection.

  • The memory application uses a creator ID and type to determine names of applications for display and to calculate total memory used by an application.

Working With Databases

Working properly with databases makes your application run faster and synchronize without problems. Follow these suggestions:

Writing Robust Code

To make your programs more robust and to increase their compatibility with the next generation of Palm Computing products, it is strongly recommended that you follow the guidelines and practices outlined in this section.

Avoiding Potential Pitfalls

Certain problems are encountered by application developers again and again. To avoid them, ask yourself these questions:

User Interface Guidelines

The Palm OS device is designed for rapid entry and quick retrieval of information. To maximize performance, the UI should minimize navigation between windows, opening of dialog boxes, and so on. The layout of application screens needs to be simple so that the user can pick up the product and use it effectively after a short time. It's especially helpful if the UI of your application is consistent with other applications on the device so users work with familiar patterns.

This section helps you design a user interface that's intuitive, easy to use, and consistent with other applications on the device. You learn about these issues:

Understanding the Palm OS UI Design Philosophy

This section considers some issues that underlie the design of a user interface for the Palm OS device. It discusses these topics:

Creating Fast Applications

On a PC, users don't mind waiting a few seconds while an application loads because they plan to use the application for a certain amount of time.

The Palm OS paradigm, in contrast, resembles that of a watch: People want instant access to information. Speed is therefore a critical design objective for hand-held organizers and is not limited to execution speed of the code. The total time needed to navigate, select, and execute commands can have a big impact on overall efficiency.

The user should be able to keep up with someone on the telephone when setting up appointments, looking up phone numbers, and so on. Priorities include the ability to:

Matching Use Frequency and Accessibility

PC user interfaces are typically designed to display commands as if they were used equally. In reality, some commands are used very frequently while most are used only rarely. Similarly, some settings are more likely to be used than others. For example, a 3 p.m.- 4 p.m. meeting occurs much more frequently than a 3:25 to 4:15 meeting.

More frequently used commands and settings should be easier to find and faster to execute.

To make your application easily accessible, follow these guidelines:

Choose the appropriate UI object when making a speed versus screen layout decision:

Creating Easy-to-Use Applications

Users must be able to pick up a Palm device and, with no training or instruction, navigate between applications (without getting stuck) and execute basic commands within five minutes. Advanced commands should be easily accessible but should not be in the way.

The design must therefore fit the following criteria:

Ease of use amounts to a series of trade-offs. Striking the best balance for the most people is the biggest challenge of UI design. For example:

Creating a Palm OS User Interface

The small screen and pen-based user interaction require a different UI paradigm than a desktop computer. Here are some guidelines for making your application's interface consistent with other applications, including the PIM applications.

This section provides information on a variety of UI design issues:

Navigation Guidelines

Users can move through applications by the following methods:

Preferences Guidelines

Palm OS 2.0 and later has improved preferences facilities. They are available through launch codes, discussed in the chapter "Application Launch Codes" in the Palm OS SDK Reference.

The system now offers application-specific panels, sticky panels, and quick switch, as follows:

Data Entry Guidelines

Users can enter data by the following methods:

To provide a consistent interface, follow these guidelines when designing the data entry interface for your application:

Item (right-justified): Value(left-justified)

for example:

Set Date: 4-1-96
Auto-off after: 2 minutes


  • Don't nest dialog boxes too deeply.

  • Provide only one interface per function, that is, allow users to interact with an application through either a button, menu, or popup list. Don't provide both a button and a menu for the same actions.

    NOTE:  

    All developers are urged to include the rules listed below in their test plan. Applications that don't follow these rules may cause problems for other applications on the device.


  • Whenever a field for user input is available, make sure that:

    • System keyboard is available via shortcut
    • System keyboard is available via menu
    • Graffiti input is possible (regular strokes and shortcuts)
    • Cut, copy, paste, and undo are possible

  • Be sure to handle the clipboard correctly. If you use it, allow users to copy and paste between applications; if you don't, make sure it's intact when you exit.

Command Execution Guidelines

Users can execute commands by the following methods:

Guidelines for Screen Layout

The illustration below provides some interface guidelines. Each guideline is numbered and explained in more detail below.

In the title bar for each screen, provide both the application name and the name of the screen, if possible. Otherwise, provide the most relevant information. Always go to the edge of the screen; that is, don't use borders. This practice maximizes screen real estate available to the application. The non-active area of the LCD and the case provide a natural margin. Use the resources provided with the development environment and use the recommended values for width, height, and so on, provided in "Palm OS Resources" in the Palm OS SDK Reference. Align buttons with the bottom edge of the screen. For text surrounded by borders, leave one pixel above and below the font height. For controls that can be displayed in groups, have at least two pixels to the left and right of the text label. The exception is command buttons, which require wider margins to accommodate the rounded border. Don't change or obscure the Graffiti status indicator area. Don't change or obscure the silk-screened icons.

Guidelines for Dialog Box Layout

The illustration below provides some guidelines for dialog box interfaces. Each guideline is numbered and explained in more detail below under the same number.

Provide online help for dialogs. If you associate a Help ID with a form in Constructor, the system will add the "i" icon and handle presentation of the dialog. Use bold face for labels, nonbold for editable items. In the details dialog, right-align the label and left align the editable field. When using buttons in dialogs, leave a space of 3 pixels between the edge of the dialog and the buttons. Align dialogs with the bottom of the screen. Leave the screen title bar visible if possible.

Palm OS Resource Selection: List or Table?

Many developers find it difficult to decide whether to choose a list or a table for certain components of their application.

Use tables when you need quality text handling (including editing in place). Be careful if you work with non-text items in some of the columns, the selection region may be smaller than you need.

Use lists when users select from a predefined list (e.g. categories) or if the application determines the information to be displayed on the fly (based on previous user selections). Remember that you are responsible for scroll button handling and that editing can be non-trivial.

Localization Guidelines

If you're planning to localize the Palm OS software that you're developing, start by looking at the localized versions of the four PIM applications on the device. Then plan your application's interface, keeping in mind localization issues listed below. Also see the chapter "Localized Applications", which describes guidelines for writing code in a localized application.

Making Your Application Run on Different Devices

There are many different devices that run Palm OS, and each may have a different version of the OS installed on it (see Table 2.1). Users are not expected to upgrade the Palm OS as frequently as they would an OS on a desktop computer. This fact makes backward compatibility more crucial for Palm applications.

Table 2.1 Some Palm Computing platform devices 

Name Palm OS Version
Pilot 10001 1.0
Pilot 5000a 1.0
PalmPilota 2.0
PalmPilot Professionala 2.0
Palm III 3.0
IBM Workpad 2.0 or 3.0
Symbol SPT 1500 3.0
Qualcomm pdQ 3.0
Palm IIIe 3.1
Palm IIIx 3.1
Palm V 3.1
Palm VII 3.2
Palm IIIc 3.5
1

No longer available.

This section describes how to make sure your application runs on as many devices as possible by discussing:

Running New Applications on an Older Device

Releases of the Palm OS are binary compatible with each other. If you write a brand new application today, it can run on all versions of the operating system provided the application doesn't use any new features. In other words, if you write your application using only features available in Palm OS 1.0, then your application runs on all devices. If you use 2.0 features, your application won't run on the earliest Palm Computing platform devices, but it will run on all others, and so on.

How can you tell which features are available in each version of the operating system? There are a couple of way to do so:

Programmatically, you can use the feature manager to determine which features are available on the system the application is running on. Note that you can't always rely on the operating system version number to guarantee that a feature exists. For example, Palm OS version 3.2 introduces wireless support, but not all Palm OS devices have that capability. Thus, checking that the system version is 3.2 does not guarantee that wireless support exists. Consult the "Compatibility Guide" in the Palm OS SDK Reference to learn how to check for the existence of each specific feature.

Compiling Older Applications With The Latest SDK

As a rule, all Palm OS applications developed with an earlier version of the Palm Computing platform SDK should run error-free on the latest release.

If you want to compile your older application under the latest release, you need to look out for functions with a changed API. For any of these functions, the old function still exists with an extension noting the release that supports it, such as V10 or V20.

You can choose one of two options:



Palm OS Programmer's Companion

  Previous Page Table of Contents Index Next Page  

This is page 71 of 85 in this book

Palm Computing Platform Development Zone
Copyright © 2000, Palm, Inc. All rights reserved.