Appendix D:
Writing A Palm VII
Query Application (PQA)

(From
PalmPilot: The Ultimate Guide
by David Pogue.)
Dave Menconi
Web Clipping Project Lead
Palm Computing

 

As explained in Chapter 16, a Palm Query Application (PQA) appears to the Palm VII owner as just another application, much like the Memo Pad or Calculator. But in reality, it’s a database that’s given special treatment by the operating system. When you tap it, the operating system opens it with a program you can’t see.

In addition, a PQA is different from other applications in what it can do. It can collect information and display information, but it can’t process information like most programs. Since it connects to the Internet, this inability to actually crunch data is not as great an impediment as it seems -- there are literally thousands of computers that can do processing for you!

A PQA usually consists of a form (or query) that you’re supposed to fill out. The Palm VII sends the form data to a server on the Internet, which processes the query and returns information in the form of a tiny Web page. But that’s not the only use for PQAs, as you’ll see in this appendix; a PQA can also serve as a single-screen application launcher or even as an illustrated, attractively designed electronic book, complete with tappable hotlinks to other chapters (or even other PQAs).

This appendix provides a brief overview on making your own PQAs. This discussion assumes that you know what HTML is, that you’re able to create simple Web pages already, and that (for commercial-quality PQAs) you know what a CGI script is and how to interact with one. For more complete discussion of writing Palm VII query applications, see the book "Palm VII Query Apps: The Developer’s Guide" (O’Reilly, 1999).

General Procedure

To create a PQA, you start with an HTML web page on your desktop computer. The page can contain standard HTML 3.2 codes plus small, four-color grayscale graphics. You run your finished Web page through a free Windows program called QABuilder, which converts the HTML and images into a PQA. (You can get QABuilder from http://www.palm.com/devzone/palmvii.) You can then install the PQA onto your Palm VII and run it like any other application. Details on these steps later in this discussion.

At this writing, QABuilder is for Windows only. However, expect to see it on other platforms before long.

In designing the Web page, you’ll probably want to use a standard web browser and editor; more sophisticated HTML generators tend to be harder to control. Many of the things you can do with HTML are very inefficient for a Palm VII -- and some HTML tags don’t work at all on the Palm VII , as described later in this appendix.

3 Kinds of PQA

There are essentially three levels of complexity in PQAs, corresponding to the complexity of the Internet server with which they communicate.

Self Contained

Although few people realize it, the PQA format is ideal for creating electronic documents that don’t connect the Internet at all. Instead of using the Doc electronic-book format described in Chapter 10, consider creating a PQA for this purpose. The huge advantage is that, unlike plain -text Doc files, a PQA can contain pictures, a wide variety of text formatting, layout formatting such as tables and headers -- and, best of all, hyperlinks. These links, in the form of buttons or underlined text, can link to other spots within the same document or even to other PQAs.

The CD-ROM accompanying this book contains two examples of these self-contained PQAs. The "Guess" folder contains a frivolous guessing game (see Figure D-1). "DevPQA" is this appendix in PQA form.

Figure D-1
The PQA format makes a terrific electronic document format, complete with graphics, formatting, links and even some interactivity as this number guess game demonstrates.

WWW Links

Another kind of PQA can consist solely of links to the web, without much of a Palm VII-based form at all. This sort of document is like a Doc file that does nothing but retrieve information from the World Wide Web, instead of taking up space on your Palm VII. Such a document is especially useful for accessing data that changes over time.

Be careful, however, when creating links to ordinary Web pages. The Palm VII doesn’t handle everyday, graphic-filled pages well. Even a simple page can contain thousands of bytes of information -- and the Palm VII user is paying for every byte. It’s better to link to special Web pages design for the purpose that contain minimal graphics.

On the CD, you’ll find the "BBC" PQA, which links to the BBC interactive news page. (Use these links with discretion -- some of the news articles can be very large.) Also on the CD is the "Pogue" PQA, containing links to David Pogue's web page.


Figure D-2
A PQA can contain links to Web sites which is especially useful when the links point to pages which change over time.

Next

<