Upcoming Events

Where the Cloud Touches Down: Simplifying Data Center Infrastructure Management

Thursday, July 25, 2013
10:00 AM PT/1:00 PM ET

In most data centers, DCIM rests on a shaky foundation of manual record keeping and scattered documentation. OpManager replaces data center documentation with a single repository for data, QRCodes for asset tracking, accurate 3D mapping of asset locations, and a configuration management database (CMDB). In this webcast, sponsored by ManageEngine, you will see how a real-world datacenter mapping stored in racktables gets imported into OpManager, which then provides a 3D visualization of where assets actually are. You'll also see how the QR Code generator helps you make the link between real assets and the monitoring world, and how the layered CMDB provides a single point of view for all your configuration data.

Register Now!

A Network Computing Webinar:
SDN First Steps

Thursday, August 8, 2013
11:00 AM PT / 2:00 PM ET

This webinar will help attendees understand the overall concept of SDN and its benefits, describe the different conceptual approaches to SDN, and examine the various technologies, both proprietary and open source, that are emerging. It will also help users decide whether SDN makes sense in their environment, and outline the first steps IT can take for testing SDN technologies.

Register Now!

More Events »

Subscribe to Newsletter

  • Keep up with all of the latest news and analysis on the fast-moving IT industry with Network Computing newsletters.
Sign Up

Netdesign Manual

Part 4

Java XML Programmers Reference

Chapter 11: XML Tools for Information Appliances


October 15, 2001


Brought to you by:





Check It Out!

Here is the final installment of a 4-part chapter excerpt from the book Java XML Programmers Reference by Mohammad Akif, Steven Brodhead, Andrei Cioroianu, James Hart, Eric Jung and Dave Writz; ISBN 1861005202; published July 2001, 750 pages.

Sample Application: Contact Infrared Beamer

In this section, we'll show you how to install the Java KVM and Palm OS Emulator on your machine. Then we'll bring together some of the different technologies we've talked about in this chapter — Java and XML on a Palm OS device. We'll create a complete lightweight Java XML application using these tools:

  • Java KVM for J2ME — the Java Kilobyte Virtual Machine (KVM) is designed to operate with as little as 160 to 512 KB of total memory. See Java KVM.
  • NanoXML — a lightweight DOM-style XML parser and document generator. See NanoXML.
  • Palm OS Emulator (POSE) — software that emulates the hardware of different Palm devices (Palm III, Vx, VII, etc.). This will be our unit testing platform. See Palm OS Emulator.

The application allows data entry of contact information into a custom Palm database we'll call the contact book. The term database in Palm OS lingo is rather deceiving as there is no way to create and drop tables on the database. It's better to think of a Palm OS database as permanent data residing in a section of non-volatile memory. The section is comprised of variable-length records. Each record is a variable-length array of bytes. There aren't tables, columns, or rows in a Palm OS database at all. Nevertheless, database is standard terminology.


A Palm OS "database" is not a database in the traditional sense. Rather, it is a persistent store comprised of any number of variable-length records. Each record is a variable-length array of bytes up to 64KB.


Our application will beam contact information from a custom Palm database (called the "contact book") to the same database on another Palm OS device. Data will be packaged as an XML document on the sender's side, and received and parsed on the receiver's side. The user will then be prompted to accept the data into his contact book or not. If accepted, XML will be stored natively as a new record in the contact book database. The application also provides a mechanism to enter, search, view, and edit contact entries in the contact book database.



Setting Up the Environment

In this section, we'll walk through the setup and installation of the Java KVM and POSE.

CLDC and Java KVM

First, download the J2ME CLDC v1.0.2 (see CLDC), and the kjava overlay from:

http://www.sun.com/software/communitysource/j2me/cldc/download.html

Unzip j2me_cldc-1_0_2-fcs-winunix.zip first. Then unzip j2me_cldc-1_0_2-fcs-kjava_overlay.zip using the same directory base in which you unzipped the first file. Overwrite any existing files.

The first archive contains the CLDC reference implementation for Win32, Solaris, and Linux. It includes source code, runtimes, tools, and documentation for porting the CLDC to other platforms. This archive is designed to be used with a profile (see Profiles).

Since there is no PDA Profile implementation yet (see PDA Profile), we'll use the CLDC-compatible port for the Palm contained in the overlay archive. This is the second archive you downloaded, the kjava overlay. The overlay installs Palm-specific tools, samples, the all-important package com.sun.kjava (see Package com.sun.kjava), and KVM.prc — the Java KVM packaged as a Palm application.


The overlay is not intended to be used alone; it must be installed after and on top of the first archive, overwriting any existing files.


Palm OS Emulator (POSE)

We'll use the POSE as our testing platform as we write our code. The POSE runs on Win32, Solaris, or Linux (although you could compile it for another platform as the source code is available). Remember our application will beam addresses from one Palm OS device to another. Obviously, the POSE doesn't have an infrared port since it's just software. So to test the application fully you must have two Palm OS devices (Handspring Visors, Sony Cliés, or IBM Workpads are fine).

Step 1 — Install the Emulator

First, download the emulator from http://www.palmos.com/dev/tech/tools/emulator/. It is available for Windows (as a ZIP file), Macintosh (as a SIT file), and for UNIX (source code in a TAR that you must compile). Extract the file.

Step 2 — Obtain a ROM Image

Before the emulator will operate, it needs a binary image of the environment to be emulated. The base installation doesn't come with any ROM images. If you own a Palm OS device, you can download an image of that device's ROM using the emulator. Simply run emulator.exe, which was installed in Step 1, and select "Download a ROM image from a Palm OS device." Detailed instructions are then given; it's really quite a simple process.

If you don't own a Palm OS device, you can download a ROM image from the Palm web site (http://www.palmos.com/dev/tech/tools/emulator/#roms). You'll need to join the Palm Alliance Program, which simply requires you to fill out an online form.

Step 3 — Run the Emulator for the First Time

Now you should run emulator.exe, which was installed in Step 1. Click the new button, Start a new emulator session. Under ROM file, select Other and navigate to the .ROM file you obtained in Step 2. The device field should automatically populate, but if it doesn't, select the correct Palm device type. Leave skin as generic. Finally, select the RAM size that corresponds to the actual RAM of the device you are emulating (for example, if emulating a Palm Vx, you should set this value to 8192KB, click OK. The emulator will then start.

Step 4 — Install the Java KVM On the Emulator

Now we must load the virtual machine onto the emulator. Right-click anywhere on the emulator. From the pop-up menu, select Install Application/Database and Other. Navigate to j2me_cldc/bin/kjava/palm and select KVM.prc. The virtual machine will be installed. Now do the same for j2me_cldc/bin/kjava/palm/KVMutil.prc. KVMutil is a debugging utility that allows you to set the maximum heap size and screen output (System.out) options.


PAGE: 1 | 2 | 3 | 4 | 5 | 6 | 7 | NEXT PAGE
 
Vendor Comparisons
Network Computing’s Vendor Comparisons provide extensive details on products and services, including downloadable feature matrices. Our categories include:

Research and Reports

Network Computing: April 2013



TechWeb Careers