Although testing OTA
provisioning of your mobile game with a real web server and a real
mobile phone is ultimately your goal before releasing the game to the
general public, there is a way to simulate the provisioning process. The
KToolbar application that ships with the J2ME Wireless Toolkit allows
you to run a MIDlet in “OTA mode,” which simply means that the MIDlet is
downloaded and installed from a local file as if it was being delivered
remotely via OTA provisioning. This is an incredibly useful feature for
testing mobile game installation without having to rely on a real web
server and phone.
To run a MIDlet in OTA mode, follow these steps:
1. | Copy the game folder (HighSeas, for example) to the apps folder within the J2ME Wireless Toolkit install folder.
|
2. | From the KToolbar menu, click Project; then Run via OTA.
|
3. | Follow the steps in the emulator to install and run the MIDlet.
|
The first step is
necessary so that the game is accessible as a project from within
KToolbar. The second step then launches the J2ME emulator in OTA mode,
which simulates the game being delivered over a wireless network
connection. The last step involves interacting with the emulator’s AMS,
which is ultimately responsible for allowing you to carry out the
installation of the game.
After an initial
splash screen, the emulator displays an option enabling you to install a
mobile application. Selecting this option results in the display of a
text entry form where you can enter the URL of the MIDlet delivery web
page, as shown in Figure 1. What’s nice in this case is that the delivery web page is generated for you automatically, as is the URL.
Accepting the URL for the
delivery web page results in the emulator downloading the page for the
MIDlet and then searching it for links. Figure 2 shows the web page being downloaded into the emulator.
After finding a JAD file for the High Seas 2 MIDlet, the J2ME emulator displays the file for you to select (see Figure 3).
After you select the High
Seas 2 JAD file and proceed onward, the emulator downloads the JAD file
and retrieves MIDlet information from it. Figure 4
shows a Confirmation screen for the High Seas 2 installation that
enables you to see information about the MIDlet before finalizing its
installation. Notice that the JAR file size (95K), MIDlet version, and
software vendor are all displayed on this screen.
If you select Install to
move forward with the High Seas 2 installation, you will be presented
with a download screen similar to the one shown in Figure 5.
Upon successfully
downloading the MIDlet to the emulator, you will finally see the MIDlet
added to the list of installed applications, as shown in Figure 6.
The
figure reveals that you can now launch the MIDlet and play the game.
You might also notice that an Update option is visible on the emulator
menu. Updating a MIDlet is similar to installing a MIDlet, except that
the update takes place only if there is a newer version of the MIDlet
available. If you recall, the version number is listed right there in
the JAD file, so it’s possible to look for a new version of a MIDlet
simply by checking the JAD file quickly. This makes it easy for you to
offer updated games that users can download easily.