T
his is third part of the "Java ME Beginners Tutorial" series. If you haven't read the previous parts you can begin here (Java ME Beginners Tutorial : Introduction).

This section explains in-depth about the Sun's Wireless Tool kit(WTK). We have already discussed the Installation of WTK.

When you install WTK seven menu entries are made for you. They are:


  • Default Device Selection
  • Documentation
  • OTA Provisioning
  • Preferences
  • Run MIDP Application
  • Utilities
  • Wireless Toolkit 2.5

Default Device Selection







After you write your code and compile it, you will be emulating the behavior of your application using an emulator that's built into the WTK. This avoids the need for a physical mobile device to install and test your app each time you make a modification. Since there are a wide variety of mobile devices on the market each with a different look and feel, WTK provides us with four different emulators each having a different screen size and look and feel.

The "Default Device Selection" menu entry points to \bin\DefaultDevicew.exe. It is a simple utility which enables us to make a particular emulator as our default emulator.

Documentation


An excellent documentation for the Wireless Tool Kit. It also includes the API reference for CLDC, MIDP and a number of other popular packages. (Don't worry if you don't understand what's CLDC and MIDP. It will be explained later). Go throught the FAQ section in the documentation. It is a must read!

OTA Provisioning


The Java ME platform has the ability to download and install a Java application over a wireless network (usually on demand). This is called OTA(Over The Air installation) For this, after developing the application we need to place the application on a special server. Once we have done this, we can use the WTK emulator to download and install the application. If OTA works fine in emulator it ought to work fine in an actual mobile device.

The "OTA Provisioning" menu entry points to \bin\emulatorw.exe -Xjam. That is, it invokes the emulator with a particular command line switch "-Xjam". It displays the default emulator as shown below.

Select "Apps" and then Menu -> Launch.
You will see a text entry where you can give the web address of your application to be installed.

Preferences







The menu entry "Preferences" points to \bin\prefsw.exe. The preferences window allows you to change many configuration settings of the Tool kit. These include the Network Proxy, the heap size available,adjusting emulator performance, enabling memory and network monitoring, enabling profiling, tracing, changing the emulator's storage space etc.

Utilities







The "Utilities" menu entry points to \bin\utilsw.exe. It is similar to the Windows Control Panel as it is a collection of multiple utility programs. It contains utilities like the Database Cleaner which removes all database records in the default emulator, the memory & network monitor, the profiler, midlet signing utility etc.

Wireless Toolkit 2.5







This is the most important one. It points to \bin\ktoolbar.exe. It is important because we use it to perform all major tasks in Java ME application developing - compiling, packaging and testing (and more).


An important thing to know is that WTK is not an IDE. It doesn't have any means for code editing. You will have to use an external text editor like notepad for creating .java files.

We can classify the main window into three parts:

  1. Menu Bar
  2. Tool Bar
  3. Console Area

This have been marked in the figure:

How to use WTK will be discussed as we begin coding.






Previous:Installation Table of Contents Next:Java ME Basics