O'Reilly logo

Palm OS Programming, 2nd Edition by Neil Rhodes, Julie McKeehan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Find

In this section, we discuss the Find feature of the Palm OS. First, we give you an overview of Find, the UI, and its intended goals. Second, we walk through the entire Find process from beginning to end. Third, we implement Find in our sample application and discuss important aspects of the code.

Overview of Find

The Palm OS UI supports a global Find—a user can find all the instances of a string in all applications. The operating system doesn’t do the work, however. Instead, it orders each application, in turn, to search through its own databases and return the results.

There is much to be said for this approach. The most obvious rationale is that the operating system has no idea what’s inside the records of a database: strings, numbers, or other data. Therefore, it’s in no position to know what’s a reasonable return result and what’s nonsense. Indeed, the application is uniquely positioned to interpret the Find request and determine the display of the found information to the user.

Find requests are sent from the OS by calling the application’s PilotMain (see Section 5.5) with a specific launch code—sysAppLaunchCmdFind —along with parameters having to do with interpreting the Find.

The objectives of Find

Speed on the handheld is essential, so Find is intended to be a quick process. Here are some of the things the OS does to ensure this:

Does not create global variables

An application’s global variables are not created when it receives the sysAppLaunchCmdFind launch code. Creating, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required