Order the book from O'Reilly

Previous PageTable Of ContentsIndexNext Page

In this chapter:

Preface

The Palm Phenomenon

Top Of Page

By almost anybody's standard of measure, the PalmPilot and other Palm devices are wildly successful. Everybody loves them: users buy them faster than any other handheld, product reviewers give them awards, and programmers, once they find the platform, never want to leave.

How do we account for this phenomenon? What makes the Palm handheld such a great device? Simple. It's really fast, it's cheap, it does almost anything you ask it to, and it can fit in your shirt pocket. Combine that with loyal users and one of the most ardent developer followings seen since the glory days of the Mac, and you have all the elements of a whirlwind success. If you are a programmer, the question you should really be asking yourself right now is, "What do I need to know to join in the fun?" To find out, keep reading.

Who This Book Is For-C Programmers

Top Of Page

If you know C and you want to write applications for Palm devices, then this is the book for you. It doesn't matter if you own a Palm and are an avid user, or if you are only now thinking about getting one. You can be a wretchedly poor student who wants to mess around with a PalmPilot in your spare time using free development tools, or a programmer in a Fortune 500 company who just got told that you have to write an application for the 5,000 units the company is deploying in the field next month.

We have tried hard to make sure that there is useful information for everyone, from beginning Palm programmers to those of you who have already danced around the block with these lovely little devices. If you want to write an application that reads barcodes, we help you; if you want to write an application to deploy a sales force, we show you what to do.

Do You Need to Know C++?

It doesn't hurt if you know C++, but it isn't necessary, either. C is just fine for creating a Palm application. C++ does come in handy if you are going to write a conduit (we will talk more about that in minute).

Do You Need to Be a Desktop Expert
to Write a Conduit?

Writing a Palm application can be a two-part adventure. You may want to create an application for the handheld device and a desktop application that will talk to the Palm application. If you want to write a conduit (the code that handles the exchange of data between the Palm and the desktop), then you will need to know about the desktop (Windows or Macintosh). We tell you how to write the conduit, but not a lot about how to create a desktop application. For that you will need some outside resources.

Which Flavor Conduit Do You Want-C++ or Java?

You can use either C++ or Java to write a conduit. We discuss some of the issues and help you figure out which path you want.

What This Book Is About and How
to Read It

Top Of Page

This book shows you how to create a Palm application and a conduit. It assumes that you have the Palm OS documentation (available at the Palm Computing web site, http://www.palm.com/devzone) and know where to find things in it. Before showing you how to create an application, we also spend some time explaining the difference between a good application and a bad one; in other words, we tell you how to design for this platform.

The Breakdown of the Chapters

Part I, Palm-Why It Works and How to Program It, gives you the big picture. You learn about the devices, their history, their development environments, and the right way to design a Palm application.

Chapter 1, The Palm Solution

We happily admit that this chapter is unabashedly partisan. Would you want someone who doesn't like the Palm Computing platform telling you about it? We also describe which features can be found on which devices and what you can expect to see in the future.

Chapter 2, Development Environments and Languages

Here we show you the choices in development environments and the range of languages you can use.

Chapter 3, Designing a Solution

We ruminate about the best way to design a Palm application and offer you some advice. We end this chapter by showing you the design of an application and its accompanying conduit that we are going to create in the book.

Part II, Designing Palm Applications, takes you inside a Palm application. We describe its structure, user interface elements, and the Application Programming Interface (API) for the various parts of the application.

Chapter 4, Structure of an Application

We take you through the whole cycle of a Palm application, from the time it is launched by the user to the moment it quits.

Chapter 5, Forms and Form Objects

Here you'll learn how to create the various user interface elements of the application-everything from buttons to alerts, from lists to gadgets.

Chapter 6, Databases

We explain the unique way the Palm OS creates data structures and stores data on a Palm device.

Chapter 7, Menus

We show you how to create menus and the items in them. You also learn how to use Palm's Graffiti shortcuts and which menus should be where.

Chapter 8, Extras

We cover a little bit of this and a little bit of that in this chapter. The topics are tables, find, beaming, and barcodes (for use with the Symbol SPT 1500, a Palm Computing platform handheld).

Chapter 9, Communications

This chapter gives you a detailed look at communications on a Palm OS device, everything from serial to TCP/IP.

Chapter 10, Debugging Palm Applications

Last, but most important, we turn to the crucial topic that is the bane of every programmer's existence-debugging. We show you how to figure out what's wrong with your code.

Part III, Designing Conduits, covers conduits. Just as we created a Palm application, we do the same for conduits. This section includes everything from a complete description of the parts of a conduit to development platforms for them and code walkthroughs. Unlike the other two sections, these chapters build on each other and should be read in order.

Chapter 11, Getting Started with Conduits

We start once again with the bigger picture. After we describe all the general things you need to know about conduits, we finally turn to a small amount of code that forms the shell of a conduit.

Chapter 12, Uploading and Downloading Data with a Conduit

This chapter takes you a step further, and you see how to upload and download data between the desktop and the conduit.

Chapter 13, Two-Way Syncing

In this chapter, we show you a conduit that uses full-blown data syncing, with the exchange of data depending on where it has last been modified. We also describe the various logic problems you encounter with a device that can synchronize data on various desktops.

Chapter 14, Debugging Conduits

We return to the topic of debugging, this time of conduits.

Appendix: Where to Go From Here

This appendix lists Palm developers' resources.

How to Read This Book

There are a few standard approaches people use to read a book on programming.

The skip-through approach

If you choose this approach, view Part I as background information. This section is more essential for beginners to the Palm Computing platform than for old-timers. If you already know which development environment you are going to use, you can ignore Chapter 2. If you want to understand the design decisions we made in the sample application and what makes the difference between a good and a bad Palm application, then you need to read through Chapter 3.

You can skip around Part II or read its chapters in order. In either case, don't wait too long to read Chapter 10. No matter what, read this chapter before you try to create your own project.

Part III won't make much sense unless you read it in order. Each chapter builds on the previous chapter.

The cover-to-cover method

We didn't write the book in this order, but it seemed like the right progression at the time.

The in-front-of-a-computer approach

Anxious types should read the debugging material before taking too deep a plunge into creating an application. Otherwise, far be it from us to try to slow you down. Get to it!

What's in a Name-Is It a Pilot
or a Palm?

Top Of Page

We have to take a moment here to talk about both the name of this book, Palm Programming: The Developer's Guide, and about Palm devices in general. If you are a loyal Palm user, then you probably call it a Pilot. So does virtually everyone else on the planet, except the company that makes them-3Com. The producers of these dandy devices want you to think of Palm not as a device, but as a platform, the Palm Computing platform. They do this, reasonably enough, so that you realize that all the following devices use the same operating system, even though different companies make and sell them:

Why 3Com went from the use of Pilot to Palm can be summed up in one word-lawsuit. Lawyers for the French Pilot Pen company contacted lawyers at 3Com and said, "Hey, Pilot is our name; stop using it." So 3Com did. Now, while we could spend hours talking about the questionable wisdom of letting a pen company tell a computer company to throw away a wildly popular, highly recognized trade name, that doesn't change our problem. People call them Pilots; the company calls them Palm devices.

As if the situation weren't interesting enough, add the entrance of the lumbering giant, Microsoft. Noticing the success Palm Computing was having with its popular devices, Microsoft's leaders said, "Hey, we're going to make some, too, and we're going to call them PalmPCs." While Microsoft eventually backed off from the name PalmPC to palm-sized computers, the damage had already been done-the Palm name had been compromised. Now we have to worry that people will not know whether we are talking about a PalmPilot device or a Windows CE-based palm device in this book. It's enough to make a writer cry.

So here's our problem: we want to make the folks at Palm Computing happy, and we want to make sure readers know what we are talking about in the book from just looking at the title. Our compromise solution was Palm Programming. We wrote this book to last a long time, and we are betting our title on 3Com's ability to move consumer attachment from the word Pilot to the word Palm.

At the time we went to press, the dust hadn't settled yet; it wasn't clear whether 3Com would be successful in wresting the Palm name away from Microsoft. If they are, the book has the right name, and you picked up Palm Programming for the right reasons. If Microsoft wins-not an unbelievable possibility, however unhappy the concept makes us-then you may have picked up this book thinking it would help you with the Microsoft Windows CE programming of palm-sized devices. Sorry for the confusion.

Conventions Used in This Book

Top Of Page

We use a couple of conventions worth noting.

Italic is used for a variety of things: URLs, filenames, functions, email addresses and other things we wanted to emphasize.

Code comes in either small batches or larger amounts, but it is always represented in constant width.

Code elements such as parameters (basically, any code other than function names) also use a constant-width font when they are included in a sentence.

NOTE:

Notes with an owl icon consist of tips or hints.

NOTE:

Notes with a turkey icon are warnings.

How to Contact Us

Top Of Page

We have tried very hard to make sure that all the information in this book is accurate. If you find a problem or have a suggestion on how to make the book better, please let us know by writing or emailing us at:

You can also send us messages electronically. To be put on the mailing list or to request a catalog, send email to:

To ask technical questions or comment on the book, send email to O'Reilly technical support:

or you can send email to us, the authors:

Versions of Things

Top Of Page

We use a lot of tools in this book. As an easy point of reference, here is each product and the version of it that we used:

Check O'Reilly's PalmPilot Center at http://palmpilot.oreilly.com or see the web page for this book at http://www.oreilly.com/catalog/palmprog/.

What's on the CD?

Top Of Page

Whom We Need to Thank

Top Of Page

If you haven't already figured out that the people at Palm Computing deserve an enormous amount of gratitude, we will tell you now. Many people deserve our thanks, starting with Maurice Sharp, head of Developer Technical Support (DTS) at Palm Computing. He coordinated the dispersal of proof chapters and had the fortitude to read the whole manuscript while managing all the rest of his duties. Other DTS people who read the entire manuscript were David Fedor, Cheri Leonard, Gary Stratton, Bruce Thompson, and Ryan Robertson. Keith Rollin in Engineering also read the whole manuscript and gave us great comments, especially about debugging tools. If you have ever tried to do a technical review of a proof copy, you know how much work this is. These folks went the extra mile and obviously read on their own time (food spills are a sure-fire indicator of a dedicated individual), and for this we thank them profusely. If this book is useful to you, remember that these people had a great deal to do with that.

Other people at Palm Computing reviewed individual chapters in their own areas of specialty and gave us great advice. These include some folks in Engineering: Dan Chernikoff (for serial port communications), Bob Ebert, Roger Flores, Steve Lemke, Kelly McCraw, Chris Raff, and Tim Wiegman. Three managers also took time out of their schedules to make sure we covered enough of the bigger picture. They are Daniel Pifko (HotSync Product Manager), Phil Shoemaker (Tools Engineering Manager), and Bill Witte (OS/SDK Product Manager). All these people read drafts of chapters and sent back tons of useful technical comments, and we thank them.

The Palm Computing staff also provided a lot of technical assistance. We can't begin to say how nice it is to be able to ask for technical help, ask questions, ask about problems, and get answers, usually within a day or two. The folks at Symbol Technologies also helped us out. Rob Whittle, Product Manager of the SPT 1500, got us a beta unit of the SPT 1500 and gave many useful comments and other help.

We also recruited some readers to see if the book would make sense. These readers included C programmers new to the platform and people who might well know more about programming the Palm than we do. This list of volunteers who deserve recognition includes Stephen Beasley, Edward Keyes, J.B. Parrett, and Stephen Wong. Edward Keyes offered especially insightful and thorough comments.

Now, over to the publishing side of things. Many thanks to our editor, Mark Stone. It was very nice to have an editor who read and actually understood our writing. Mark time and time again caught inconsistencies and sloppy descriptions and gently told us when we were mumbling. For two authors who don't like writing, Mark's competence and professionalism made the task almost palatable.

On the personal side of things, we have a few people to thank as well. As always, we need to thank our children, Nicholas, Alexander, and Nathaniel, who can never figure out why either of us writes books. We also thank our friends and families, who put up with our annoying tendencies to fade out of conversations, be late, and be absolutely boring while we are writing.


Palm Programming: The Developer's Guide
Copyright © 1999, O'Rielly and Associates, Inc.
Published on the web by permission of O'Rielly and Associates, Inc. Contents modified for web display.

Previous PageTop Of PageTable Of ContentsIndexNext Page