Mobile Phone DevelopmentColin P. Fahey
![]() FIGURE: Sun's "J2ME Wireless Toolkit Version 1.0.4_01" download page. ![]() FIGURE: Sun's "J2ME Wireless Toolkit Version 1.0.4_01" FTP site list. This will download the following file: "j2me_wireless_toolkit-1_0_4_01-bin-win.exe" Execute this program to install on your system. J2ME WIRELESS TOOLKIT : LAUNCH TOOLBAROnce the toolkit is installed, you can launch it from the "Start" menu system:![]() FIGURE: Starting the toolbar application. You can also access MIDP-1.0 documentation via the "Documentation" item in this start menu. ![]() FIGURE: "J2ME Wireless Toolkit Version 1.0.4_01" Documentation. J2ME WIRELESS TOOLKIT : CREATE PROJECT AND BUILD![]() FIGURE: Toolbar is ready. Click "New Project..." to create a new project. ![]() FIGURE: New Project: Type in project name (becomes JAR name and name of new project directory), and type in MIDlet class name (class derived from MIDlet, essentially the main class of your application). ![]() FIGURE: Toolbar: Project created. Notice that the console tells you where to put your *.java source files, etc. (e.g., "c:\WTK104\apps\sbj\src", etc) ![]() FIGURE: Click on "Settings..." on the toolbar to get this project settings menu. Disregard the "MIDlet-Jar-Size" field (with value "100" bytes) for now. We will eventually cause the correct value to get set. ![]() FIGURE: Click on the MIDlets tab of the project settings dialog. Click on the only row in the table ("MIDlet-1") to highlight and select it. Then click the "Edit" button. FIGURE: Clear the "Icon" field if you do not have a *.PNG file to put in your JAR file. ![]() FIGURE: Do the following: (1) Project --> Clean : Removes all *.class files. (2) Build : Builds all *.class files and preverifies. (3) Project --> Package --> Create Package : Produces *.JAR and *.JAD When you do these three steps, the resulting *.JAR and *.JAD are immediately ready for execution in the local emulator, or for immediate deployment on your WWW site for others to download Over The Air (OTA). The *.JAR size field in the *.JAD file will be correct. Don't forget to do step (3) every single time you rebuild! Now you can test by hitting the "Run" button. ![]() FIGURE: Hitting "Run" for the project reads the JAD in to the emulator. You can select the specific MIDlet to launch (typically just one). Just copy the *.JAR and *.JAD files from the specified locations (reported by the toolbar's console window during a build of the project), such as: (From the console window:)
![]() FIGURE: Sam's Blackjack Trainer (sbj.jar) running on my phone.
|