Java Reference
In-Depth Information
Sun's J2ME Wireless Toolkit Emulators
The J2ME Wireless Toolkit includes several different emulators that you can use to test your
applications. When you click the Run button in the J2ME Wireless Toolkit, your application is
launched in the currently selected emulator.
The Wireless Toolkit Devices
The J2ME Wireless Toolkit 2.2 contains four main device emulators:
DefaultColorPhone is a device with a 240×320-pixel color screen. This is the device shown
later in Figure 2-2 and is used for most of the screen shots in the remainder of this topic.
DefaultGrayPhone has a 108×208 pixel grayscale screen.
MediaControlSkin is similar to the default phone emulator and has a color screen of
108×208 pixels, but its buttons are labeled with controls like a music player: a square
for stop, a triangle for play, volume control buttons, etc.
QwertyDevice is a smartphone with a 636×235-color screen and a miniature QWERTY
keyboard.
Running MIDlets
Sun's MIDP reference implementation includes an emulator named midp . It emulates an imag-
inary MID, a mobile telephone with some standard keys and a 182×210-pixel screen. The J2ME
Wireless Toolkit includes a similar emulator, as well as several others.
Once you've got a preverified class file, you can use the midp emulator to run it. The emulator
is an application that runs under J2SE and acts just like a MIDP device. It shows itself on your
screen as a representative device, a generic mobile phone. You can run your MIDlet by typing
the following at the command line, assuming you added \midp\bin to your PATH :
midp Jargoneer
If you're using the J2ME Wireless Toolkit, you can simply choose an emulator from the
Device combo box and click the Run button to fire up your application.
If all goes well, you'll see something like the window shown in Figure 2-2 in the next
section. Congratulations! You've just built and run your first MIDlet.
Search WWH ::




Custom Search