News Archive (1999-2012) | 2013-current at LinuxGizmos | Current Tech News Portal |    About   

Article: A developer’s perspective on PocketLinux

Feb 22, 2001 — by Rick Lehrbaum — from the LinuxDevices Archive — 1 views

Foreword: This article is the fifth in a LinuxDevices.com series on Exploring Linux PDA Software Alternatives by Jerry Epplin that explores the history, status, alternative architectures, and future developments of Linux on PDAs and handheld devices. In this episode, Epplin installs and evaluates the use of Transvirtual Technolgies' PocketLinux as a Linux-based software environment for a Compaq iPAQ PDA.



PocketLinux on the iPAQ

Previous articles in this series have addressed some of the approaches taken for running Linux on PDAs, including those by Century Software and Trolltech. Up to this point, we have concentrated on distributions for the Compaq iPAQ because Linux has been most mature on that platform, thanks to the Compaq-sponsored handhelds.org Linux-on-handhelds project. Other Linux-based PDAs are now becoming available, and we intend to cover them soon. In the meantime, this article takes a brief look at PocketLinux, a distribution based on Linux, Java, and XML.

Like the other distributions, PocketLinux for the iPAQ uses the handhelds.org kernel and builds a GUI platform on top of it. But PocketLinux, provided by Transvirtual Technologies, is in a sense more ambitious than the others, in that it is targeted toward development by both programmers and non-programmers.

A tale of two technologies: XML and Java

XML and Java are the two technologies that form the core of PocketLinux.

XML is used for screen layout. Widgets can be defined using a syntax similar to that of HTML's table definitions. A syntax is also defined for progressing from one screen to another, and simple data manipulation can be performed using XPath, a technology related to XML. So simple applications can be developed using only XML and its related technologies.

More sophisticated applications require Java. Transvirtual is the maintainer of the Kaffe virtual machine, and this technology forms a key part of PocketLinux.

Getting to know PocketLinux

Coming up to speed on PocketLinux software development can be tricky, especially for those unfortunate buzzword-impaired folks not yet conversant in XML and Java. Here's a summary of the steps typically required . . .

  • Get a book on XML. Study it. The new O'Reilly nutshell book is quite good.

  • Get a book on Java. Study it.

  • Download the PocketLinux Developers Guide. Study it. As you may know, XML is essentially a syntax for storage of and transfer of data. The structure and meaning of the data is defined externally. PocketLinux is a specific “application” of XML; i.e., essentially a set of tags and how to use them. It is important to understand that just being familiar with XML does not qualify you to write XML-based applications in PocketLinux; you have to understand the specific tags and how they are used in PocketLinux. So this step is quite independent of the previous two — the syntax is defined by XML, but the semantics are PocketLinux-specific.

  • Write a few sample applications to develop a feel for which parts belong in XML and which belong in Java. Some functionality can be implemented using either technology, and the optimal dividing line between the two domains may not be immediately obvious to the newcomer.

  • Finally, write the application.
The easy-language Catch 22

Transvirtual's motivation for separating applications into XML and Java is that simple applications can be written in XML alone. Therefore, non-programmers can customize their systems if their needs are sufficiently basic. Of course, even such non-programmers would have to get past the first and third steps listed above.

The Java/XML strategy reminds me a bit of the “easy syntax” option provided by the old “fourth generation languages” (4GLs), wherein code written by entry-level programmers could supposedly be translated automatically into working COBOL. However, the translators typically could only handle 90 percent of the application's needs, which left the programmer sifting through the resulting COBOL code to implement the remaining 10 percent. Naturally, the nontranslated 10 percent turned out to be the trickiest parts of the code — with the result that the level of COBOL expertise needed to get the system working was no less than what would have been required to write the application entirely in COBOL in the first place.

Similarly, if you're serious about writing a PocketLinux application, you'd better be prepared to write some Java — because you don't want to run into the limitations of the XML interface and end up unable to complete the app. Additionally, the resulting application is not portable, since some or all of it is written in the PocketLinux XML application. Which raises the question: Given the likelihood that serious PocketLinux development is limited to Java programmers, why use the XML interface at all, especially in view of its non-portability?

Development environment

For better or worse, the PocketLinux XML/Java combination must be considered together as one development environment. Aside from the learning curve, in which a programmer must become familiar with a number of technologies before development can begin, the problem of defining the best practices for this hybrid “language” must be solved.

It seems likely that experienced Java developers will prefer to implement the bulk of their programs in Java, with little more than a wrapper in XML. On the other hand, those with little or no Java experience will strive to implement as much as possible in XML, resorting to Java only when necessary.

For rapidly prototyping a system that is unlikely to need maintenance, this need not be a problem. But for a larger commercial system involving multiple programmers and maintenance over a period of time, the differing practices would likely result in chaos.

Application performance

PocketLinux has attracted considerable attention because of some impressive multimedia applications that have been ported to it. These have good performance, possibly because they are mostly implemented natively rather than in the XML/Java environment.

You might expect XML/Java applications to have poor performance because of the runtime system's combination of interpretation and just-in-time compilation. Interestingly, however, the performance of PocketLinux 1.0 is quite acceptable — at least on the iPAQ, a high-end PDA.

In conclusion . . .

A major appeal of Linux on PDAs is that Linux programmers can simply use their favorite desktop tools to develop PDA-based applications. Your favorite combination of Python/Perl/C/C++/FLTK/Qt/whatever can be quickly ported to a PDA like the iPAQ; and aside from the platform issues of differing input and output, application development is not much changed from development on the desktop.

One of my main reservations about PocketLinux therefore concerns its programming model, which makes good software engineering difficult, and which makes it hard to take advantage of the body of Linux software that is available. Unless the PocketLinux combination of XML and Java becomes popular on the desktop — a prospect that seems unlikely — no such desktop/handheld cross-pollination will occur, and PocketLinux development will remain a narrow specialty. For serious software development it is likely that most programmers will choose one of the other PDA Linux distributions.

PocketLinux might be expected to appeal to those users who are already familiar with Java and XML, since coming up to speed would then consist only of learning the PocketLinux XML application and developing a feel for segmenting the design between XML and Java. Getting past these hurdles results in an environment in which simple applications can be developed rapidly. As a rapid prototyping environment, PocketLinux makes considerable sense — a front end can be set up quickly in XML, with back end functionality implemented in Java.



About the author: Jerry Epplin has written embedded software for the past fifteen years, primarily for medical devices. He can be reached at [email protected]





The following articles may also be of interest . . .

 
This article was originally published on LinuxDevices.com and has been donated to the open source community by QuinStreet Inc. Please visit LinuxToday.com for up-to-date news and articles about Linux and open source.



Comments are closed.