ColdFusion MX Professional Projects

Team-Fly

Sun's MIDP Emulator

Sun's MIDP reference implementation includes an emulator named midp. It emulates an imaginary MID, a mobile telephone with some standard keys and a 98 × 130-pixel screen. The J2MEWTK includes an almost identical emulator, as well as a pager emulator.

Running MIDlets

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 that acts just like a MID. 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

Or, if you're using the J2MEWTK, you can simply choose an emulator from the Device combo box and click the Run button to fire up the emulator.

If all goes well, you'll see something like the window shown in Figure 2-1. Congratulations! You've just built and run your first MIDlet.

Figure 2-1: Buttons on the mobile phone emulator

Using the Emulator Controls

The J2MEWTK emulator appears as a generic mobile phone, as shown in Figure 2-1.

Sun's J2MEWTK emulator exhibits several qualities that you are likely to find in real devices:

Environment Variables

The emulator included with Sun's MIDP reference implementation can be controlled via environment variables. One of the most interesting ones is SCREEN_DEPTH, which determines the bit depth of the emulator's screen. Possible values are shown in Table 2-1.

Table 2-1: SCREEN_DEPTH Values

VALUE

MEANING

1

Black and white

2

Grayscale, 4 levels

4

Grayscale, 16 levels

8

Color, 256 colors

SCREEN_DEPTH and the other environment variables that can be used are documented in the docs\midp-env.html installed in the reference implementation directory.

The Wireless Toolkit Devices

The J2MEWTK includes the four device emulators that follow:

You can easily switch to a different emulator by choosing it from the Device combo box.


Team-Fly

Категории