Note: The example described in this section is demonstrated using a development environment that includes Eclipse and S60 MIDP SDK Third Edition. The information also applies to the Series 40 SDK, even though that has not been used here. For more information on the recommended MIDP development environments, see the document MIDP project structure.
This section shows you how to create a HelloWorld example from scratch and run it with an emulator. The example creates a "Hello World!" message in a text box , which appears on the screen of your mobile device. The example illustrates the following functions:
Basic MIDlet life cycle
Use of high-level user interface components (using the TextBox
class)
Simple command handling
The implementation of the example application consists of the following classes:
HelloWorldMIDlet.java
, which represents
the entry point of this application and creates the actual text to be shown
in the text box.
HelloScreen.java
, which creates an implementation
of the TextBox
class with three visual areas: a title,
a string, and a command area. It also implements the CommandListener
interface
used to receive user input from the command area.