Program Java devices -- An overview

Get up to speed on Java for small devices

Not so many years ago, computers were huge boxes requiring tremendous quantities of air conditioning and protection. They were hidden away within special rooms located within large corporations and research centers. There weren't very many of them, and each had many users. CPU time was extremely expensive, and access and availability were often quite limited. Oh, how the world has changed!

Today, we can see three distinct but overlapping eras of computing:

  • Mainframe era: one computer, many people
  • PC era: one person, one computer
  • Ubiquitous-computing era: one person, many computers

Most of us use more computers embedded in devices and appliances than we do PCs, workstations, and mainframes combined. For instance, a quick inventory of my average workday shows that I use a laptop, a couple of servers, and a workstation. But the car I use to commute to work each day has many more CPUs than all of those traditional computers put together! When we include the computer chips in mobile phones, Palm handhelds, microwave ovens, Ethernet hubs and the communication equipment we use at work (the phone system, and so on), you can see that we're already firmly planted in the era of ubiquitous computing.

Not only are CPUs everywhere, but almost all of our interactions with CPUs involve (or very soon will involve) interactions with networks. How can you as a programmer take advantage of computers and networks embedded everywhere in heterogeneous devices and environments?

Java technology enables ubiquitous network computing

Many articles on the history of Java describe its early days as having been device-oriented. Java was originally designed for nontraditional computing devices; over time, it moved up into desktops and servers. From the beginning, Java's small bytecode size, ability to move objects around networks, and cross-platform portability were engineered to enable programming for small, mobile, heterogeneous devices. It luckily turned out that these features were also quite useful in an interconnected, Net-based world on bigger computers.

Java technology has come full circle, and programming devices with Java is once again on the rise. In this column, I will examine the various APIs, tools, and products available for Java programming for various consumer devices, such as personal digital assistants (PDAs), mobile phones, pagers, and similar embedded computers.

As these articles unfold, I hope you will gain a greater appreciation of both what Java can do for these devices and how you can take advantage of them in future projects.

Major Java device APIs and initiatives

Sun and its partners are building a number of Java device environments and APIs:

  • PersonalJava, including numerous implementations from RTOS (Realtime Operating System) vendors. It supports consumer devices with a GUI and network connection.
  • EmbeddedJava, for devices with intermittent or no network connection and often no GUI. It is highly configurable to include only those classes and VM features needed for a particular device.
  • JavaCard, including Dallas Semiconductor's iButton implementation (the ever popular Java ring being one form factor for its delivery).
  • Java 2 Platform, Micro Edition (J2ME) and the K Virtual Machine (KVM) for consumer devices are the latest additions. Early preview versions were demonstrated at JavaOne (June 1999) running on Motorola PageWriter2000x, Palm III and V hand-held devices, Bull point-of-sale (POS) terminals, and next generation mobile phones from Matsushita/Panasonic and other manufacturers targeting NTT DoCoMo's i-mode service. They will enable Jini support for small devices, as well as enable splitting up computing functionality between device and server, so that device footprint can be minimized.
  • Symbian, a partnership between Nokia, Ericsson, Motorola, and Matsushita/Panasonic, providing Java support for the EPOC32 mobile phone and wireless communicator operating system.

In addition, several other companies have independent clean-room Java for consumer and embedded device initiatives. Among these, the most talked about technologies include:

  • Various independent Palm VMs, such as the Ghost VM and WabaVM; Java conduit and related technologies are also available from third parties
  • Transvirtual Technologies's Kaffe JVM, compliant with the PersonalJava 1.1.1 specification
  • Cygnus Solutions's GCJ static compiler front end for embedded Java development
  • Hewlett-Packard's Chai, Chai VM, and related tools
  • NewMonics's clean-room realtime Java efforts

There are also some emerging sets of consumer-oriented APIs. These API groupings, known as profiles in Sun parlance, are meant to sit on top of underlying Java runtimes and provide a certain level of portability and interoperability within classes of devices targeted at specific markets or vertical industries. Note that profiles may include other profiles -- that is, profiles can be nested.

Profiles are currently under development by working groups within the consumer device and embedded device community. Some possible profiles to watch for include:

  • Wireless profile (mobile phones and communicators), similar to Symbian's smart phone and wireless information device profiles. May include JavaPhone API.
  • POS profile.
  • Hand-held PDA profile.
  • Automotive profile (may include Java for Automotive API).
  • Set-top box/interactive television profile (may include JavaTV API).
  • PersonalJava profile, a repackaging of PersonalJava specifications to more clearly differentiate how the APIs may be provided on top of various J2ME implementations.

The profiles are still under development, but most of the platforms and tools are already available in some form. Please refer to the Resources at the end of this column for more information on each of the platforms, profiles, and other embedded Java technologies mentioned above.

The states of the major consumer and embedded Java APIs and technologies as of June 23, 1999 are revealed in the following table.

TechnologyTypeAPI specification (version)FAQReference implementation (version)Discussion e-mail list
PersonalJava Application environment (likely profile in future)Yes (1.1.1)YesYes (3.0, corresponds to 1.1.1 API)No
JavaPhone Extension API (likely part of one or more profiles)Yes (0.91)YesNoNo
JavaTV Extension API (likely part of one or more profiles)Yes (0.90)YesNoNo
EmbeddedJava Application environmentYes (1.1)NoYes (Based upon JDK 1.1.6)No
JavaCard PlatformYes (2.1)YesYes (early access)No
K Virtual Machine Runtime environmentNo (expected by end of July 1999)No (does have datasheet and whitepaper)Yes (early preview to JavaOne attendees only)Yes (refer to KVM site for subscription info)
Java 2 Platform, Micro Edition Java 2 Platform, for devicesNoNoNo (except for KVM preview at JavaOne)No (except for KVM mailing list)

Note that the above refers to publicly available information from Sun and other companies and does not include licensee-only releases or nonreference implementations. Most of this information came from links available from Sun's Java home page, from the home pages of other companies, or from public announcements and demonstrations at the 1999 JavaOne Developer Conference.

Be sure to review the URLs provided in the Resources at the end of this article for more information. The JavaOne Today article on device developments, in particular, contains a lot of useful resources and information.

Please also be sure to review the material on the J2ME Web site, as Sun's repackaging of Java 2 technology into an Enterprise Edition (J2EE), Standard Edition (J2SE), and Micro Edition (J2ME) will likely have many subtle but important consequences in the coming months.

We will explore the details of these technologies in later articles. Taken as a whole, they give developers a lot of options and opportunities for targeting devices in Java.

Device programming roadmap

I had a fair amount of success with my Media Programming column roadmap, so why not issue another? Over the course of this column, I will track the various Java device programming technologies and give as many concrete examples as possible so that you can learn about them and use them yourself. I will always provide information on any emulators and related tools that will let you get started programming devices as early as possible, sometimes even before the actual device hardware is available. (This should also keep your costs down as you follow the column and learn about programming devices.) I strongly encourage you to get your hands dirty with the code as the columns roll out.

Ideas for upcoming columns include:

  • Programming Palm devices in Java. This will include information on how to program Java-based conduits as well as compiling Java code to native instructions and interpreting Java code on the Palm itself. It will also discuss Sun and Palm runtimes and SDKs, as well as independent tools.
  • A tutorial on programming PersonalJava-compliant devices. Learn how to target PersonalJava to ensure that your applets run on set-tops and Web phones, as well as desktops and workstations. We will use the PersonalJava emulator so that you can start programming now, even if you do not yet have any PersonalJava-compliant devices.
  • The emergence of mobile phones capable of running Java and accessing Internet content. Learn about Wireless Access Protocol (WAP), Wireless Markup Language (WML), and how Java brings it all together. We will look at the publicly available EPOC Java SDK from Symbian, and at Nokia and Ericsson WAP development tools.
  • Open source and community source in the Java consumer and embedded technology marketplace. What are your alternatives?
  • Jini for consumer devices. What is available now and what will be available in the near future, including a discussion of some of the third-party development projects underway in the Jini community. We will also discuss the Jini technology's Java runtime requirements and how J2ME will address them.

As always, please let me know about topics you want covered. I appreciate any ideas or comments you care to share. I hope this column will provide you with useful information and ideas that allow you to develop networked Java applications for use throughout the ubiquitous computing infrastructure.

A note about nomenclature and conventions

I had good success with the nomenclature I used in my Media Programming columns. Therefore, I've decided to keep this nomenclature, with a couple of slight updates.

For this column, I hope to provide platform-specific tips and tricks where possible, but I will focus on Java, then Windows and Linux, since that is where I will be spending most of my time.

I will be distinct in my usage of the terms consumer and embedded. I will use the former to refer to Java for small devices and the latter for devices embedded into systems (like a network chip in the telephone system). Context should help to clear up any confusion.

I will always attempt to:

  • Write method names in the form methodName().
  • Give source code listings with line numbers included.
  • Name source code examples consistently. The top of the hierarchy will be com.billday.device, with each topic nested in at least one subpackage under this top level. For instance, all of the code for the upcoming Palm programming series will be in com.billday.device.palm.
  • Generate an up-to-date JAR archive containing all of the code and classes for the current and previous columns. This will be available from my Web site as billday.jar.
  • Make each example a standalone application or applet.

All of the source code and examples will be available under the most liberal open source or community source license I can find. (I have used the GNU General Public License in the past, but some readers have found that too restrictive; I am strongly considering the Sun Community Source License (SCSL) or something similar. If you have suggestions, please send me an e-mail.)

Conclusions

Thousands of JavaOne attendees have already started writing Java code for their Palm devices. In the next few months we will see the deployment of Java on Palms, mobile phones, and other devices increase rapidly. Millions of Palm handhelds are in widespread use today, and Symbian's partners plan to deploy 40 to 60 million Java-enabled wireless phones within the next three years. The moral of the story: Java device programming is real today, and will be extremely widespread in very short order.

Next month, I will kick off a series on Java programming for Palm devices. The time to start developing for these Java-enabled devices is now, so let's get busy!

Bill Day is a technology evangelist at Sun Microsystems and an Association for Computing Machinery (ACM) distinguished lecturer. In addition to Java Device Programming, Bill also writes a weekly Q&A column for JavaWorld's career newsletter. Bill has contributed SunWorld, Gamasutra, and JavaSoft feature articles and speaks frequently on Java-based multimedia and consumer device programming.
1 2 Page 1
Page 1 of 2