O'Reilly logo

Wireless Java by Qusay H. Mahmoud

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. GuiTests.java

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required