Getting Started With ProScout - A Sample Java ME Midlet with Perst Lite

McObject's ProScout midlet demonstrates the Perst Lite object-oriented embedded database for Java ME. It is possible to build and run the midlet on a wide variety of Java ME devices. ProScout has been tested on Blackberry and Nokia devices, as well as with PhoneME, an open source reference software platform that addresses the market and technical requirements of feature phone devices.

ProScout is designed as an application supporting professional sports recruiters by enabling them to gather and recall data using a mobile device such as a cell phone. For example, a user sitting in a high school gymnasium's bleachers could discreetly take notes about a recruiting prospect, or recall various teams' win/loss records. Please look at description of Perst Lite features used in ProScout application.

Step-By-Step: Building and Running ProScout

Sun Java Wireless Toolkit (WTK)

The ProScout midlet was developed using the Sun Wireless Toolkit. It is also possible to use another IDE (such as NetBeans, Eclipse with its J2ME support module, JBuilder, the BlackBerry IDE from Research-In-Motion,...) to build and run the application. In all such cases, it is necessary to create a corresponding IDE MIDP2.0/CLDC1.1 project, and import source + resource + library files from the ProScout example (contained in basketball.zip) into this project. In many cases this should be as easy as copying and pasting. Here are the exact steps for building and running ProScout using the Sun Wireless Toolkit:
  1. Download and install the Sun Wireless Toolkit (the current version 2.5 is fine) and the J2SE SDK (Java 2, Standard Edition Software Development Kit). Both products can be freely downloaded from www.javasoft.com along with full documentation and instructions.
  2. Assuming that you have extracted Sun WTK 2.5 to the home directory (so that it is located in the \WTK25\ directory), then extract Basketball.zip to \WTK25\apps directory.
  3. Using the Wireless Toolkit KToolbar, select Basketball from the Open Project menu.
  4. Build the project by executing the Build command in KToolbar menu.
  5. Run the project in WTK Emulator: command Run in KToolbar menu.
  6. Create package: click on Project/Package/Create Package menu item.
  7. Upload Basketball.jar and Basketball.jad files to the real device (upload procedure depends on the particular device - please refer to the installation of Java applications (midlets) in this device user's guide).

PhoneME Emulator

Following are the steps to run the ProScout midlet in the PhoneME Emulator (command line only):
  1. Extract the PhoneME binary distributive. Let's say that it is extracted in home directory, so path will be C:\phoneme_feature
  2. Change directory to C:\phoneme_feature\bin\win32_x86_javacall_mvm
  3. Install ProScout midlet:
    C:\phoneme_feature\bin\win32_x86_javacall_mvm> bin\installMidlet.bat C:\perst\src11\tst\midp\Basketball\bin\Basketball.jar
    
    REPORT: <level:3> <channel:1000> JavaTask() >>
    javacall_lifecycle_state_changed() event is JAVACALL_LIFECYCLE_MIDLET_STARTED status is JAVACALL_OK
    The suite was succesfully installed, ID: 2
    javacall_lifecycle_state_changed() event is JAVACALL_LIFECYCLE_MIDLET_SHUTDOWN status is JAVACALL_FAILED
    REPORT: <level:3> <channel:1000> JavaTask() >>
    
    
    Remember ID assigned to the midlet ("ID: 2" in this example).
    
  4. Run the midlet using this ID and midlet class name (do not confuse with the midlet name):
    C:\phoneme_feature\bin\win32_x86_javacall_mvm> bin\runMidlet 2 UniAR
    

Other emulators and deployment to real devices

Most mobile phone vendors provides emulators for their own devices, so you can see how the midlet will look running on the real device. Running a midlet in such a device-specific emulator usually simply involves choosing a .jad or .jar file in the emulator's Open menu item.

For example, Nokia's device emulators can be used with the Nokia Developer's Suite for Java ME. You can download emulators of different Nokia devices from Nokia's Web site, and integrate them in the Nokia Developer's Suite. Starting a midlet in one of these emulators requires the following steps:

  1. Launch Nokia Developer's Suite
  2. Click on Start Emulators icon
  3. Specify the path to the midlet .jad file (.jar file should be located in the same directory)
  4. Select emulator you want to use from the list of available devices
  5. Click Emulate

A similar approach is used for emulators of other mobile phone vendors.

Deployment of the midlet to an actual device also usually requires vendor-specific tools. Let's say the target device is your mobile phone. First, you need to establish a connection between a PC and your mobile phone (you can also install applications from the network, but this is not the case in our example). An IRDA, USB or Bluetooth connection can be used. Most of the vendors provide software for connecting from a PC to mobile phone and performing operations (like copying music files, installing applications,etc.). With some phones, to install applications it is enough to copy .jad and .jar files to a special directory on the mobile device where midlets are located.

With Nokia phones, the easiest way to install midlets is to use the Nokia PC Suite. When your PC is connected to the target device, within Nokia PC Suite you choose the folder "Install Applications" and specify the path to the .jad or .jar file. You will then have to complete the installation process by answering a few questions.