Developing New Applications

You can easily develop new Java applications for the Palm if you are familiar with the MIDlet programming model. If you have run the MIDlets in earlier chapters, or have developed new ones, you can easily turn them into Palm applications by using a converter tool, which we will describe later in this chapter. The development life cycle of a Palm application can be summarized in the following three steps:

  1. Develop a MIDlet or a MIDlet suite.

  2. Convert the JAR/JAD file pair into a PRC file (executable Palm application).

  3. Install the PRC file on the Palm and test the application.

Develop a MIDlet

As always, you can use either the Sun Microsystems Wireless Toolkit or your favorite development environment to develop a MIDlet. Example 9-1 lists the MIDlet that was developed in Chapter 6, which shows how to create various GUI components. The MIDlet for this example allows you to test lists, forms, choices, gauges, text fields, and text boxes.

Example 9-1.

import javax.microedition.lcdui.*; import javax.microedition.midlet.*; public class GuiTests extends MIDlet implements CommandListener { // display manager Display display = null; // a menu with items List menu = null; // main menu // list of choices List choose = null; // textbox TextBox input = null; // ticker Ticker ticker = new Ticker("Test GUI Components"); // alerts final Alert soundAlert = new Alert("sound Alert"); // date DateField date = new DateField("Today's date: ", DateField.DATE); // form ...

Get Wireless Java now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.