Symbian
Symbian OS Library

FAQ-1009 How do I launch the UIQ 2.1 emulator and start running a MIDlet from the command line?

[Index][spacer] [Previous] [Next]



 

Classification: Java Category: SDK
Created: 03/11/2004 Modified: 04/01/2004
Number: FAQ-1009
Platform: Symbian OS v7.0

Question:
kmidp20.exe provides the means for launching the emulator and running a MIDlet from the command line; this FAQ specifies how this can be done.

Answer:
Firstly to support running MIDlets when installing the UIQ 2.1 SDK ensure that you enable the "UIQ 2.1 MIDP SDK" package installation option.

When launching kmidp20.exe from the command line the classpath and descriptor paths must be relative to an emulator drive. For example if you create a HelloWorld subdirectory on the emulator c: drive ie:

\epoc32\wins\c\HelloWorld\

and place HelloMIDlet.jar and HelloMIDlet.jad files in that directory then the command to start the emulator and run the MIDlet becomes

\epoc32\release\wins\udeb\kmidp20.exe -classpath c:\HelloWorld\HelloMIDlet.jar -descriptor c:\HelloWorld\HelloMIDlet.jad HelloMIDlet

where the final argument "HelloMIDlet" refers to the MIDlet name ( ie the "Name" value of the MIDlet- attribute in the application descriptor (JAD) file) not the name of the class that extends MIDlet.

eg
MIDlet-1: HelloMIDlet, , HelloMIDletClass


If you want to avoid cluttering up your emulator c: drive with development work another solution is to map your own emulator virtual drive. For instance you might create a working directory for your development work as shown below.

\epoc32\JavaApps

To map an emulator virtual drive to this location you need to create an text file named epoc.ini (if it doesn't already exist) located in the

\epoc32\data\

directory and add the following line to it

_epoc_drive_t \Symbian\UIQ_21\epoc32\JavaApps

(renaming the directory as appropriate). Note there is a space between _epoc_drive_t and the path. The drive letter is arbitrary, as long as its not already allocated (eg not c: or z:)

So for JAR and JAD files in the \epoc32\JavaApps\HelloWorld\ directory the command becomes:

\epoc32\release\wins\udeb\kmidp20.exe -classpath t:\HelloWorld\HelloMIDlet.jar -descriptor t:\HelloWorld\HelloMIDlet.jad HelloMIDlet


To install a MIDlet so that it can be launched from the App Launcher view see FAQ 0845