Install the MIDP for Palm OS Application Runtime Environment
|Figure 5. Installing MIDP for Palm on the Palm Emulator|
MIDP for Palm OS is a Java runtime environment for Palm OS handhelds that enables a device running the Palm OS to run a J2ME application. The MIDP for Palm OS Version 1.0 runtime environment is compliant with the Connected Limited Device Configuration (CLDC) 1.0 specification as well as the Mobile Information Device Profile (MIDP) 1.0 specification.
|Figure 6. The Newly Installed Java HQ Palm Application|
Download the MIDP for Palm OS zip file and extract it into a directory on your hard drive. The directory should contain a subdirectory named midp4palm1.0\PRCfiles. Navigate to that directory and look for the file called MIDP.prc. To install MIDP for Palm onto the emulator, drag and drop the MIDP.prc file to the emulator as shown in Figure 5.
To install MIDP to a real Palm device, you would simply use the Palm Install tool and then synchronize your PC with your Palm device.
Your installation efforts should show a new Java HQ icon (see Figure 6).
Clicking on the Java HQ icon gives you some background information about Java MIDP (see Figure 7).
|Figure 8. Installing the Sample MIDP-based Games|
To test out your J2ME Palm setup, you can drag and drop the file Games.prc onto your emulator just as you did the MIDP.prc file. You will install some games that are MIDP-based Java applications as shown in Figure 8.
Double click on the Games. You should be presented with a Sun Microsystems Binary Code License Agreement. Read through the agreement and click the Accept button (you will need to accept the agreement only for the first time you run a MIDP-based application on your Palm device).
If your Java MIDP environment was installed properly on your Palm, after accepting the agreement you should be asked to choose a game (see Figure 9).
|Figure 9: Verifying the MIDP Environment Was Correctly Installed on Your Palm|
|Figure 10. Pointing the J2ME Toolkit Install to Your J2SDK Install|
At this point, click the Home button on your Palm. With your Java runtime environment installed, you are now ready to create a Java application that you'll deploy to your Palm (emulated) device.
Obtain and Install the J2ME Wireless Toolkit
Although not a full J2ME tutorial, this section does provide a quick overview of what you have to do to create a simple MIDlet. You need to have the J2ME Wireless Toolkit installed. You can download
it from java.sun.com (at the time of this article's writing, the toolkit was in version 2.2). The toolkit requires that you have the Java 2 SDK (J2SE SDK), version 1.4.2 installed. During the toolkit install, you will be asked to point to the J2SE install directory as shown in Figure 10