The K-Zone: Some notes on OpenZaurus

I've recently added a Sharp Zaurus to my gadget collection. The Zaurus is one of the first PDA devices to run Linux in its factory configuration. However, there are a number of problems with the factory Linux configuration so, like many other users, I've converted my Zaurus to use the OpenZaurus distribution. There is a lot of information on the OpenZaurus Web site,  and I don't propose to repeat it here. Rather, this article describes some of the things I had difficulty with, and which don't seem to be well documented anywhere else. It is based on OpenZaurus 3.3.5.

Memory and storage

Here are a few general issues relating to memory and storage in OpenZaurus.

Desktop integration

Sharp has been reasonably good about making the Zaurus easy for Linux developers to target with their applications. The company has been less good about making the Zaurus appeal to Linux users, rather than developers. In particular, the latest version of their desktop synchronization software only works on Microsoft Windows platforms. Eugh! Despite this, it is relatively straightforward to get data in an out of a Zaurus, certainly compared to other hand-held devices.

User interface

Applications

Some general comments about application support in OpenZaurus...

Networking

Development

I think it's probably fair to say that developing applications for the Zaurus is not an entirely satisfactory process. On the one hand, it is a Linux system, and it's not difficult to obtain and configure a cross-compiler that will compile C/C++ code for the Zaurus. If you want to compile console applications, or even device drivers, there's no great problem. On the other hand, real problems begin when you want to develop GUI applications. Procedures for doing this in C++ are poorly documented, and generally rely on proprietary SDKs. To be fair, the SDKs are freely available for non-commercial use, but it is irritating that you need more than GCC and a few header files to produce applications. Of course, the development of GUI applications in Java is extremely well documented, and requires very few software tools that you don't already have. Specifially, you need a Java compiler (JDK) and a text editor. I found that PersonalJava apps that I wrote for the Sony-Ericsson P800 mostly worked on the Zaurus without modification. However, even if you are a Java developer, developing for the Zaurus isn't without its problems, as we shall see.

C/C++ Development

To develop C++ GUI applications for OpenZaurus, you will need to master either Qtopia, or Opie. Qtopia is a palmtop variant of Trolltech's Qt GUI model, so Qtopia applications aren't very different from Qt applications. If you're familiar with Qt programming in, say, the KDE environment, you should find that working with Qtopia is not that different. Opie provides a user interface model built on top of Qtopia so, in short, to develop for Opie you need to understand how to develop of Qtopia as well. Qtopia is the more general platform, as this will work on the factory Zaurus as well as OpenZaurus. However, it is possible to install the Opie libraries on a factory Zaurus, and get Opie support as well. So there isn't much to choose between them. Both are equally ugly to program, if you're used to the purity of, say, the Java Swing model.

The problem with Qtopia and Opie is that both require proprietary tools for development. To be fair, you can get these tools free-of-charge for non-commercial use, but if you want to develop commerical applications, you'll need to pay for your tools. There's nothing inherently unreasonable about this -- I had to pay for the other tools of my trade, after all. It's just that this isn't what we've come to expect when working in the Linux world. In addition, the basic tools come bundled with a whole heap of other clever things, like IDEs and build management tools. You may, or may not, like to use this sort of thing. Personally, I don't. My favoured build tools are make,gcc, and vi. You can (just about) built Qtopia apps using these simple tools, but it's not well documented.

Ranting aside, here's what you will need to develop for Qtopia on OpenZaurus.

So, assuming you know how to code Qtopia applications (or are prepared to learn), the build process is simple. (1) Write your application with each user interface element declared in a .h file and implemented in a .cpp file. (2) Run moc on each .h, file, which gives you another heap of .cpp files. (3) Compile all the .cpp files into .o files using the ARM version of g++. (4) Link the .o files with glibc and Qtopia libraries you got from the Zaurus.

If you don't know how to code Qtopia applications, you've got an uphill struggle ahead of you, but there's plenty of examples and documentation on the Trolltech web site.

Java Development

The stock Zaurus is supplied with a Java Virtual Machine (JVM) called `Jeode', originally produced by Insignia. Insignia sold its JVM business, and it seems now to have disappeared. The bad news for OpenZaurus users is that the latest versions of Jeode -- those supplied with 3.x series Sharp firmware -- don't seem to work. However, if you can get hold of one, a 2.x-series Jeode will work. I am using this all the time, with reasonable results (but see below).

The other JVM is an implementation of the `J2ME Personal Profile' from Sun Microsystems, which you can get from java.sun.com. This one does work out-of-the-box with OpenZaurus, but there are a few problems. First, you'll need to install a library called libfloat.so which is not supplied with the JVM. The download location is in the release notes, and you'll need it even if you don't plan to run any application that does floating-point arithmetic -- the JVM won't start without it. The second problem is that, with OZ 3.3.5, the JVM's main window does not align properly with the top of the screen. This means that you can't see the title bar. Again, you can work around this, but it's a nuisance.

Whichever JVM you use, there are general problems with Java on the Zaurus. The JVM is not as well-integrated into the Zaurus desktop environment as Qt applications are. For example, if you pop up the virtual keyboard to enter text with the stylus, it takes up the bottom third of the screen. Most Qt applications dynamically resize to accomodate this loss of screen area. There does not seem to be any way to do this in Java -- the virtual keyboard just obscures the application. Also, Java applications take a lot longer to start up the C applications, and use a lot more RAM while they are running.

If you can live with these limitations, and you can find a JVM version that works properly, Java development on the Zaurus is more-or-less trivial, so long as you know Java. The user interface is provided by standard AWT objects, and these behave much as they do in any other JVM. If you use Jeode, you're stuck with a fairly ancient API (it is officially compliant with JDK1.1.8, as per the PersonalJava Specificiation), which means that modern applications may need some tweaking. With the Sun JVM, a significant part of the JDK1.4 API is available, which makes porting modern applications more straightforward.

Other languages

I understand that there are reasonably complete implementations of Perl and Python for OpenZaurus, but I haven't tried these so I can't comment.

©1994-2006 Kevin Boone, all rights reserved