Java and PDAs are a powerful combination. Although PC sales have arguably peaked, PDAs are very much in a growth phase. In 2003, PDA sales should reach 19.5 million units and go on to reach 35 million units by 2005.
Java is also a huge market, with millions of developers working world-wide in all areas of computing: from mainframes to matchbox-sized Web servers.
What This Book Is About
This book is about using Java to develop PDA applications. Having spent many years writing applications initially in C and later in C++, I felt that Java was a giant leap forward when I started using it in November 1995. I wrote this book because I wanted to develop applications for PDAs, but I did not want to go back to writing applications in C. After learning Java and realizing its power for developing a wide range of applications, I did not want to step back. Perhaps you feel the same way.
Aside from ones personal preference for any specific development language, there are numerous business reasons to use Java to develop PDA applications. First, your organization may be already using Java to develop enterprise systems. A large amount of time, money, and effort has probably been invested in building up Java expertise, tools, and resources.
Second, you may be attracted by the ability to write portable applications using Java 2, Micro Edition (J2ME). Just as Java code is portable across platforms supporting the other editions of Java 2 (Enterprise and Standard), applications written for J2ME are portable across platforms supporting the same configurations and profiles. However, its fair to say that applications written for the Standard and Enterprise editions of Java 2 are more easily portable across platforms than applications written for the Micro edition. This is because, unlike the other editions, Micro edition applications target severely constrained devices. Because the platforms targeted by the Micro edition differ from each other in terms of memory and screen real estate much more than their enterprise and desktop counterparts, configurations and profiles dictate the features that are available on each platform. However, Micro edition applications that are written for one platform that supports a configuration and profile combination are quite portable to other platforms supporting the same combination. Its a nice feeling to know that an application written for J2ME on a PDA is usable on other devices supporting the same configuration and profile, and vice versa. This is vastly different from writing applications in C or C++ for the same devices. Well be talking about configurations and profiles in subsequent chapters.
Third, you may wish to re-use simple business logic in your devices applications that has developed for other applications. You may want to check for a valid credit card number on the PDA application, and you may have a corporation-wide standard class for card number validation.Any or all of these are good reasons to be interested in Java on PDAs.Once you want to develop PDA applications using Java, you are faced with the secondary decision about which Java to use. There are several options. This book focusses on options that conform to the J2ME and PersonalJava standards because these are open standards for Java on resource-constrained devices. The standards are open because specifications are created as part of the Java Community Process, which is open to all developers for contributions and review of drafts.
The scope of the book includes developing Java applications for the Palm and PocketPC PDAs using J2ME and PersonalJava, respectively. Strictly speaking, PersonalJava is part of the Java 2 Standard Edition (J2SE) family rather than J2ME, but it is included in the books scope because most PocketPCs come with Personal-Java installed. Additionally, as I write, implementations of the J2ME replacement for PersonalJava (the Personal Profile, which we will discuss in subsequent chapters) have not yet arrived for the PocketPC.
Although the applications presented in this book will run on other platforms, such as mobile phones, the specific intent is to focus on applications that run on PDAs and the considerations a PDA developer should keep in mind.
In the book, we will consider the end-to-end solution for integrating a PDA into the enterprise. As such, the book does include some server-side code.Not included is coverage of other PDAs, such as the Sharp Zaurus. To make the book manageable, I decided to concentrate on the two dominant products in the PDA market. Also not included is coverage of PocketPCs running operating systems other than WindowsCE, such as iPaqs that run Linux.The book does not cover Java-like languages for PDAs such as Waba, since they are not based on the open Java standard.
Audience
This book is written for developers who already know Java and who want to write Java applications for PDAs, in particular PocketPC and Palm devices. It is my intention to present the necessary concepts in practical terms, so that a Java developer can pick it up and start writing PDA applications in Java quite quickly. It assumes that you already have some Java experience with the Standard and/or the Enterprise editions.
This is not a book for people interested in learning Java. If that applies to you, I suggest buying an introductory Java book and downloading J2SE from java.sun.com. Learning Java with J2SE is a much better way to get started.
Rather than bulking up this volume with page after page of source code listings, I have made the source code available for download from the book's companion Web site at www.javaonpdas.com. This allows me to ensure that the most up-to-date code is available. Likewise, I also prefer that the book is taken up with truly useful information. I hope you agree that this is a good idea.
Development Environment
The chapters are intended to be independent of any particular development environment. In Chapter 3, “Setting Up the Development Environment,” we discuss the options for a development environment. Whichever environment you initially choose, or to which you subsequently switch, the source code in other chapters will remain useful.
The development platform used in all the examples is Windows. This is not intended to imply that the examples will only work on Windows. The tools Ant, Tomcat, and Axis work on multiple platforms. The J2ME Wireless Toolkit from Sun is also available on Solaris and Linux, and the Palm OS Emulator is available on the Mac and Unix in addition to Windows. Generally, it is noted where tools run on other platforms, but I have not tried to run the tools on other platforms. I have tried to be platform-neutral as much as possible though, so if you are running a desktop operating system other than Windows the book is hopefully still useful to you.
Daryl Wilding-McBride
April 2003
0201719541P06022003