7.1. MIDlets
In MIDP, the basic unit of execution is a MIDlet. A MIDlet is a class that extends the class javax.microedition.midlet.MIDlet and implements a few methods—including startApp, pauseApp, and destroyApp—to define the key behavior of the application.
As an example of programming with the MIDP application model, consider the following program that implements one of the simplest MIDlets possible: the canonical “Hello World” application.
package examples; import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class HelloWorld extends MIDlet implements CommandListener { private Command exitCommand; private TextBox tb; // Constructor of the HelloWorld class public HelloWorld() { // Create "Exit" Command so the user ...
Get Programming Wireless Devices with the Java™ 2 Platform, Micro Edition, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.