Java Reference
In-Depth Information
MIDlet-Vendor: Michael Kroll & Stefan Haustein
MIDlet-Jar-Size: 908
MIDlet-Jar-URL: hellomidp.jar
MIDlet-1: HelloMidp, , HelloMidp
The first five entries are self-explanatory (the jar size may differ depending on compiler options
and jar compression). The last entry, MIDlet-1 , determines the first and only MIDlet that is
available in the JAR file. By adding similar entries, it is possible to put more than one MIDlet into
a single JAD file and its respective JAR file.
The value of the MIDlet-< Number > attribute consists of three parameters:
MIDlet-< Number >: < name >, < icon >, < class >
< Number > is just an enumeration of the MIDlets in the JAR file. Our example contains only a
single MIDlet, so there is only a single entry named MIDlet-1 . If more MIDlets were stored in
the JAR file, the entries would be named MIDlet-2, MIDlet-3, and so on.
The parameter < name > describes the name of the MIDlet that is displayed on the device after the
descriptor file is loaded. The < icon > parameter specifies an icon that can be displayed in the list.
The last parameter, < class > , specifies the name of the actual subclass of MIDlet implemented
by the application.
In order to start the HelloMidp sample application, place the JAD file contained in Listing 1.3 in
the same directory as the JAR file. Change to that directory and type the following command:
midp -descriptor hellomidp.jad
When executing this command, the MID emulation will show a selection menu (see Figure 1.9 ).
Select the HelloMidp entry. The screen will show the output of the HelloMidp example
(shown in Figure 1.8 ) .
Figure 1.9. The information gained from the JAD file. In this case, only one entry
( HelloMidp ) is listed.
 
 
Search WWH ::




Custom Search