04.03.2014 Views

Developing Java Applications for Intermec Computers

Developing Java Applications for Intermec Computers

Developing Java Applications for Intermec Computers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Developing</strong> <strong>Java</strong><br />

<strong>Applications</strong><br />

<strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


<strong>Intermec</strong> Technologies Corporation<br />

Worldwide Headquarters<br />

6001 36th Ave.W.<br />

Everett, WA 98203<br />

U.S.A.<br />

www.intermec.com<br />

The in<strong>for</strong>mation contained herein is provided solely <strong>for</strong> the purpose of allowing customers to operate and service<br />

<strong>Intermec</strong>-manufactured equipment and is not to be released, reproduced, or used <strong>for</strong> any other purpose without<br />

written permission of <strong>Intermec</strong> Technologies Corporation.<br />

In<strong>for</strong>mation and specifications contained in this document are subject to change without prior notice and do not<br />

represent a commitment on the part of <strong>Intermec</strong> Technologies Corporation.<br />

© 2010 by <strong>Intermec</strong> Technologies Corporation. All rights reserved.<br />

The word <strong>Intermec</strong>, the <strong>Intermec</strong> logo, Norand, ArciTech, Beverage Routebook, CrossBar, dcBrowser, Duratherm,<br />

EasyADC, EasyCoder, EasySet, Fingerprint, INCA (under license), i-gistics, Intellitag, Intellitag Gen2, JANUS,<br />

LabelShop, MobileLAN, Picolink, Ready-to-Work, RoutePower, Sabre, ScanPlus, ShopScan, Smart Mobile<br />

Computing, SmartSystems, TE 2000, Trakker Antares, and Vista Powered are either trademarks or registered<br />

trademarks of <strong>Intermec</strong> Technologies Corporation.<br />

There are U.S. and <strong>for</strong>eign patents as well as U.S. and <strong>for</strong>eign patents pending.<br />

Microsoft, Windows, and the Windows logo are registered trademarks of Microsoft Corporation in the United<br />

States and/or other countries.<br />

ii<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


Contents<br />

Contents<br />

Be<strong>for</strong>e You Begin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v<br />

Global Services and Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v<br />

Warranty In<strong>for</strong>mation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v<br />

Web Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v<br />

Telephone Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .v<br />

Who Should Read This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi<br />

Related Documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7<br />

About the <strong>Java</strong> Runtime Environment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7<br />

<strong>Java</strong> Plat<strong>for</strong>m Micro Edition (<strong>Java</strong> ME) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7<br />

<strong>Java</strong> ME Configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8<br />

Connected Device Configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8<br />

<strong>Java</strong> ME External Links. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8<br />

JVMs Based on <strong>Java</strong> ME CDC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9<br />

About the IBM WebSphere Everyplace Micro Environment. . . . . . . . . . . . . . . . . . . .9<br />

About NSIcom CrE-ME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9<br />

About the Integrated Development Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10<br />

Using the Eclipse IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11<br />

Creating A HelloWorld <strong>Java</strong> Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11<br />

Setting Project Compiling Source Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12<br />

Creating A HelloWorld <strong>Java</strong> Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12<br />

Coding the HelloWorld <strong>Java</strong> Class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .13<br />

Exporting to HelloWorld.jar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14<br />

About the JAR Warning Export Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17<br />

Deploying the HelloWorld Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17<br />

Using the NetBeans IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .18<br />

Installing the <strong>Java</strong> ME Plug-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19<br />

Installing a CDC Emulator Plat<strong>for</strong>m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19<br />

Creating a HelloWorld Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22<br />

Creating a HelloWorld Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24<br />

Coding the HelloWorld <strong>Java</strong> Class. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .24<br />

Building the HelloWorld Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25<br />

Running HelloWorld in Emulator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25<br />

Deploying the HelloWorld Application to CrE-ME . . . . . . . . . . . . . . . . . . . . . . . . . .27<br />

Deploying the HelloWorld Application to WEME . . . . . . . . . . . . . . . . . . . . . . . . . . .28<br />

Deploying <strong>Applications</strong> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29<br />

Creating the Application Shortcut File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29<br />

Copying Files to the Mobile Computer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29<br />

Running the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30<br />

Remote Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30<br />

Creating a Shortcut <strong>for</strong> Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31<br />

Deploying and Starting a Debug Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31<br />

Remote Debugging in Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32<br />

Setting Breakpoints. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32<br />

Setting and Starting the IDE Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong><br />

iii


Contents<br />

Remote Debugging in NetBeans. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34<br />

Setting Breakpoints. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34<br />

Setting and Starting IDE Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35<br />

Accessing Databases Using JDBC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37<br />

JDBC Sample Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37<br />

Building the Sample. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38<br />

Running the Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38<br />

Adapting the Sample <strong>for</strong> Other DBMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39<br />

<strong>Developing</strong> a Web Services Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40<br />

<strong>Developing</strong> a Web Services Client in Eclipse . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40<br />

Creating a StockQuoteWTK <strong>Java</strong> Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41<br />

Setting the Project Compiling Source Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44<br />

Generating Web Services Stubs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44<br />

Importing Generated Stub Classes to Eclipse. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47<br />

Creating a <strong>Java</strong> Class to Call the Web Services API . . . . . . . . . . . . . . . . . . . . . . . . . . .49<br />

Exporting Classes to StockQuoteWTK.jar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51<br />

Deploying the Web Services Client to the Mobile Computer . . . . . . . . . . . . . . . . . .53<br />

<strong>Developing</strong> a Web Services Client in NetBeans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54<br />

Creating the StockQuoteWTK <strong>Java</strong> Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55<br />

Adding Web Services JAR Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57<br />

Generating Web Services Stubs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58<br />

Creating a <strong>Java</strong> Class to Call the Web Services API . . . . . . . . . . . . . . . . . . . . . . . . . . .59<br />

Building the StockQuoteWTK Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60<br />

Deploying StockQuoteWTK onto Mobile Computer. . . . . . . . . . . . . . . . . . . . . . . . .60<br />

Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62<br />

iv<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


Be<strong>for</strong>e You Begin<br />

Be<strong>for</strong>e You Begin<br />

Global Services and Support<br />

This section provides you with safety in<strong>for</strong>mation, technical support in<strong>for</strong>mation,<br />

and sources <strong>for</strong> additional product in<strong>for</strong>mation.<br />

Warranty In<strong>for</strong>mation<br />

To understand the warranty <strong>for</strong> your <strong>Intermec</strong> product, visit the <strong>Intermec</strong> web site at<br />

www.intermec.com and click Support > Returns and Repairs > Warranty.<br />

Disclaimer of warranties: The sample code included in this document is presented<br />

<strong>for</strong> reference only. The code does not necessarily represent complete, tested<br />

programs. The code is provided “as is with all faults.” All warranties are expressly<br />

disclaimed, including the implied warranties of merchantability and fitness <strong>for</strong> a<br />

particular purpose.<br />

Web Support<br />

Visit the <strong>Intermec</strong> web site at www.intermec.com to download our current manuals<br />

(in PDF).<br />

Visit the <strong>Intermec</strong> technical knowledge base (Knowledge Central) at<br />

intermec.custhelp.com to review technical in<strong>for</strong>mation or to request technical<br />

support <strong>for</strong> your <strong>Intermec</strong> product.<br />

Telephone Support<br />

In the U.S.A. and Canada, call 1-800-755-5505.<br />

Outside the U.S.A. and Canada, contact your local <strong>Intermec</strong> representative. To<br />

search <strong>for</strong> your local representative, from the <strong>Intermec</strong> web site, click About Us ><br />

Contact Us.<br />

Service Location Support<br />

For the most current listing of service locations, go to www.intermec.com and click<br />

Support >Returns and Repairs > Repair Locations.<br />

For technical support in South Korea, use the after service locations listed below:<br />

AWOO Systems<br />

102-1304 SK Ventium<br />

522 Dangjung-dong<br />

Gunpo-si, Gyeonggi-do Korea, South 435-776<br />

Contact: Mr. Sinbum Kang<br />

Telephone: +82-31-436-1191<br />

E-mail: mjyunkang@awoo.co.kr<br />

IN In<strong>for</strong>mation System PTD LTD<br />

6th Floor<br />

Daegu Venture Center Bldg 95<br />

Shinchun 3 Dong<br />

Donggu, Daegu City, Korea<br />

E-mail: jmyou@idif.co.kr or korlim@gw.idif.co.kr<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong><br />

v


Be<strong>for</strong>e You Begin<br />

Who Should Read This Manual<br />

Related Documents<br />

This document is intended <strong>for</strong> <strong>Java</strong> developers who create applications <strong>for</strong> <strong>Intermec</strong><br />

mobile computers and peripherals. You should be familiar with:<br />

• general programming techniques <strong>for</strong> <strong>Java</strong> applications.<br />

• your <strong>Intermec</strong> computers and peripherals.<br />

• <strong>Java</strong> IDEs such as Eclipse or NetBeans.<br />

• concepts <strong>for</strong> software design.<br />

The <strong>Intermec</strong> web site at www.intermec.com contains our documents (as PDF files)<br />

that you can download <strong>for</strong> free.<br />

To download documents<br />

1 Visit the <strong>Intermec</strong> web site at www.intermec.com.<br />

2 Click the Products tab.<br />

3 Using the Products menu, navigate to your product page. For example, to find<br />

the CN3 computer product page, click <strong>Computers</strong> > Handheld <strong>Computers</strong> ><br />

CN3.<br />

4 Click the Manuals tab.<br />

If your product does not have its own product page, click Support > Manuals. Use<br />

the Product Category field, the Product Family field, and the Product field to<br />

help you locate the documentation <strong>for</strong> your product.<br />

vi<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong><br />

This document is intended <strong>for</strong> developers who create <strong>Java</strong> applications <strong>for</strong> <strong>Intermec</strong><br />

Windows Mobile and CE-based mobile computers. This document assumes the<br />

developers are already familiar with general <strong>Java</strong> programming concepts. Due to the<br />

characteristics of the mobile computers, development requirements may be<br />

different from desktop application development. This document provides<br />

requirements and development tool in<strong>for</strong>mation, and guides you through the<br />

development process with examples. It covers the following topics:<br />

• About the <strong>Java</strong> Runtime Environment<br />

Discusses the JRE requirements and provides recommendations <strong>for</strong> <strong>Intermec</strong><br />

mobile computers.<br />

• About the Integrated Development Environment<br />

Covers mobile development guidelines, and provides step-by-step instructions<br />

<strong>for</strong> creating a simple mobile application in Eclipse and NetBeans IDEs.<br />

• Deploying <strong>Applications</strong><br />

Explains how to deploy a <strong>Java</strong> application to the mobile computer.<br />

• Remote Debugging<br />

Describes how to setup the IDE and the mobile computer <strong>for</strong> remote debugging.<br />

• Accessing Databases Using JDBC<br />

Discusses the JDBC API available <strong>for</strong> mobile computers and provides an example<br />

to connect to a database. The JDBC API enables <strong>Java</strong> applications to access SQLbased<br />

databases or tabular data sources.<br />

• <strong>Developing</strong> a Web Services Client<br />

Discusses the web services support <strong>for</strong> mobile computers and provides a tutorial<br />

<strong>for</strong> developing a web services client. Web services are APIs that can be accessed<br />

over a network regardless of systems and languages.<br />

About the <strong>Java</strong> Runtime Environment<br />

The <strong>Java</strong> runtime environment contains the <strong>Java</strong> virtual machine (JVM) and class<br />

libraries necessary to run <strong>Java</strong> applications. In this document, the term JVM is used<br />

interchangeably with JRE.<br />

<strong>Java</strong> Plat<strong>for</strong>m Micro Edition (<strong>Java</strong> ME)<br />

Due to the limited resources on mobile computers, <strong>Intermec</strong> recommends a <strong>Java</strong><br />

runtime environment that is based on <strong>Java</strong> Plat<strong>for</strong>m, Micro Edition (<strong>Java</strong> ME). The<br />

<strong>Java</strong> ME plat<strong>for</strong>m consists of these elements:<br />

• Configuration – a core set of APIs and virtual machine capabilities <strong>for</strong> a broad<br />

range of devices.<br />

• Profile – a set of APIs that support a narrower range of devices. A profile is built<br />

on a specific configuration.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 7


• Optional Packages – a set of technology-specific APIs that extends the<br />

functionality of a <strong>Java</strong> application environment. Optional packages must be<br />

used in conjunction with a configuration or a profile.<br />

<strong>Java</strong> ME Configurations<br />

<strong>Java</strong> ME supports two configurations:<br />

• Connected Limited Device Configuration (CLDC) is <strong>for</strong> resource-constrained<br />

devices like mobile phones and entry-level personal digital assistants (PDAs). It<br />

has a very limited set of APIs, and is designed to run on devices with limited<br />

memory, processing power and graphics capabilities.<br />

• Connected Device Configuration (CDC) is <strong>for</strong> network-connected devices that<br />

have more memory and processing power, such as high-end PDAs.<br />

<strong>Intermec</strong> Windows Mobile and CE-based computers are certainly in the high-end<br />

PDAs category and meet the requirements of CDC; there<strong>for</strong>e, <strong>Intermec</strong> recommends<br />

CDC <strong>for</strong> <strong>Intermec</strong> computers. The focus of this document is on the CDC.<br />

CDC is a superset of CLDC; there<strong>for</strong>e, CLDC is upward compatible with CDC.<br />

However, the CLDC Mobile In<strong>for</strong>mation Device Profile (MIDP) is not compatible<br />

with CDC. If your existing application is based on MIDP and you do not wish to<br />

revamp your application <strong>for</strong> CDC, you may install a JVM that supports MIDP such<br />

as IBM WebSphere Everyplace Micro Environment with MIDP 2.0.<br />

Connected Device Configuration<br />

CDC has two versions CDC 1.0 (JSR 36) and 1.1 (JSR 218). CDC 1.0 contains a<br />

subset of APIs from <strong>Java</strong> Plat<strong>for</strong>m Standard Edition (<strong>Java</strong> SE) 1.3. CDC 1.1 provides<br />

updates and adds selected APIs based on <strong>Java</strong> SE 1.4. One of the benefits of<br />

developing with CDC is that it is upward compatible with <strong>Java</strong> SE.<br />

CDC supports three profiles: Foundation Profile, Personal Basis Profile and<br />

Personal Profile. <strong>Intermec</strong> supports Personal Profile which has full AWT 1.1 support<br />

and includes all the APIs in the Foundation Profile and Personal Basis Profile. The<br />

AWT implementation in Personal Profile is based on JDK 1.1 and has some 2D<br />

packages from <strong>Java</strong> SE.<br />

AWT provides a basic set of graphical user interface (GUI) components that were<br />

implemented using native-plat<strong>for</strong>m versions of the components. For a richer look<br />

and feel, consider other widget toolkits such as the Standard Widget Toolkit<br />

(SWT) by Eclipse.<br />

<strong>Java</strong> ME External Links<br />

For more in<strong>for</strong>mation on <strong>Java</strong> ME, see these web links:<br />

• <strong>Java</strong> ME: the Most Ubiquitous Application Plat<strong>for</strong>m <strong>for</strong> Mobile Devices<br />

• <strong>Java</strong> ME Technology - CDC<br />

• <strong>Java</strong> ME Personal Profile<br />

• CDC: <strong>Java</strong> Plat<strong>for</strong>m Technology <strong>for</strong> Connected Devices White Paper<br />

8 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


JVMs Based on <strong>Java</strong> ME CDC<br />

Sun Microsystems, now a subsidiary of Oracle Corporation, does not provide a <strong>Java</strong><br />

ME CDC implementation <strong>for</strong> the Windows Mobile plat<strong>for</strong>m. <strong>Intermec</strong> recommends<br />

the IBM WebSphere Everyplace Micro Environment (WEME) that implements<br />

CDC/Personal Profile 1.1. All the <strong>Java</strong> class libraries in the <strong>Intermec</strong> Developer<br />

Library (IDL) Resource Kits were tested against WEME. For more in<strong>for</strong>mation, see<br />

the next section, “About the IBM WebSphere Everyplace Micro Environment.”<br />

Another popular JVM <strong>for</strong> Windows Mobile/CE computers is CrE-ME by NSIcom.<br />

CrE-ME version 4 implements CDC/Personal Profile 1.0. Some applications such as<br />

SAP Mobile Infrastructure clients may require CrE-ME. You can choose this JVM if<br />

it better fits your needs, but you may not get the same level of support from<br />

<strong>Intermec</strong>. For CrE-ME related issues, you need to contact NSIcom <strong>for</strong> support.<br />

The following sections have more details on WEME and CrE-ME.<br />

About the IBM WebSphere Everyplace Micro<br />

Environment<br />

The IBM WebSphere Everyplace Micro Environment (WEME) contains the <strong>Java</strong><br />

virtual machine (J9) and class libraries necessary to run <strong>Java</strong> applications on mobile<br />

computers. It is often referred to as J9.<br />

<strong>Intermec</strong> currently resells WEME 6.2 <strong>for</strong> Windows Mobile 6.1 (P/N 454-035-001),<br />

which targets Windows Mobile 6.1 computers such as the CK3, CN3, CN4, and<br />

CN50. WEME 6.2 contains CDC/Personal Profile 1.1 with optional packages: JCE,<br />

JSSE, JDBC, and RMI.<br />

You can download the API specifications <strong>for</strong> the Personal Profile and the supported<br />

optional packages from these links:<br />

• JSR-000216 Personal Profile 1.1 Specification<br />

• JSR-000219 Foundation Profile 1.1 – Includes API specifications <strong>for</strong> JCE<br />

and JSSE.<br />

• JSR-000169 JDBC Optional Package Specification<br />

• JSR-000066 RMI Optional Package Specification<br />

About NSIcom CrE-ME<br />

NSIcom originally offered CrEme 3, which implemented Personal <strong>Java</strong> 3.1. Personal<br />

<strong>Java</strong> is based on JDK 1.1.8 and it has been discontinued. If you use this version of<br />

CrEme, you need a JDK 1.1 compiler to build your application.<br />

NSIcom later introduced a new version of CrEme based on <strong>Java</strong> ME and rebranded it<br />

to CrE-ME. CrE-ME 4 implements CDC/Personal Profile 1.0. To use the <strong>Java</strong> class<br />

libraries in the <strong>Intermec</strong> Developer Library (IDL) Resource Kits with CrEme, you<br />

must use CrE-ME version 4.<br />

CrE-ME 4 supports different Windows Mobile/CE versions. You can download trial<br />

versions from the NSIcom web site. CrE-ME 4 has advantages and disadvantages:<br />

• It supports Swing and <strong>Java</strong> plug-ins <strong>for</strong> Pocket Internet Explorer, which WEME<br />

does not support.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 9


• Its default and preferred graphics library is based on the Truffle implementation<br />

of AWT. The look and feel are different from standard AWT.<br />

• The major drawback of CrE-ME is its <strong>Java</strong> Native Interface (JNI)<br />

implementation. The JNI invocation would block the VM operation. If a JNI<br />

method is called from a thread in a <strong>Java</strong> application, all threads in the<br />

application are blocked until the JNI call returns.<br />

There are two ways to prevent a blocking JNI call from blocking the entire<br />

application. The easiest way is to specify the “-noblock” VM option in the command<br />

line you use to start your application. The preferred way recommended by NSIcom<br />

is to call the creme.Noblock.on method be<strong>for</strong>e the JNI call, and creme.Noblock.off<br />

method after the JNI call.<br />

Because of CrE-ME’s JNI implementation, some IDL <strong>Java</strong> classes (such as<br />

BarcodeReader and Imager) will not work properly. It is not desirable to add CrE-<br />

ME specific library calls in the IDL libraries. There<strong>for</strong>e, <strong>Intermec</strong> recommends that<br />

you specify the “-noblock” VM option in the application shortcut if you use the<br />

a<strong>for</strong>ementioned IDL <strong>Java</strong> classes. For more on application shortcuts, see “Creating<br />

the Application Shortcut File” on page 29.<br />

About the Integrated Development Environment<br />

Most <strong>Java</strong> Integrated Development Environments (IDEs) on the market today target<br />

<strong>Java</strong> Plat<strong>for</strong>m Standard Edition (SE) or Enterprise Edition (EE) development.<br />

However, not all <strong>Java</strong> IDEs have adequate support <strong>for</strong> mobile development.<br />

Although you may use your preferred <strong>Java</strong> IDE <strong>for</strong> developing mobile applications,<br />

there are two rules you need to follow to ensure that your application can be<br />

deployed successfully to <strong>Intermec</strong> mobile computers.<br />

• Rule #1: Know the <strong>Java</strong> standard supported by the JVM on your mobile<br />

computer.<br />

The <strong>Java</strong> IDE usually selects the highest JDK version installed on your desktop<br />

computer as the default compiler. WEME and CrE-ME implement <strong>Java</strong> ME CDC<br />

Personal Profile and some optional packages. Unless the IDE provides a JVM<br />

emulator that matches the JVM on your mobile computer, you need to be careful<br />

to call only the <strong>Java</strong> APIs supported by the target JVM. Otherwise, your<br />

application may get a runtime error even if it compiles successfully in the IDE.<br />

• Rule #2: Adjust the project compiling source level to match the JVM on your<br />

mobile computer.<br />

The byte code generated by the JDK may not be compatible with the JVM on your<br />

mobile computer. The IDE project setting should allow you to adjust the<br />

compiling source level. If the default compiler version of your IDE is JDK 1.5 (or<br />

JDK 5) or higher, you should set the compiling source level to 1.4 <strong>for</strong> both<br />

WEME and CrE-ME. If you use javac to compile your source code, you should<br />

add “-source 1.4” to the compiler options.<br />

The next sections walk you through building a simple HelloWorld application using<br />

two popular, open-source IDEs, Eclipse and NetBeans.<br />

10 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


Using the Eclipse IDE<br />

The Eclipse IDE is one of the most popular <strong>Java</strong> IDEs. There are numerous plug-ins<br />

available to extend the capabilities of the IDE. Although Eclipse has a plug-in called<br />

Mobile Tools <strong>for</strong> <strong>Java</strong> (MTJ), the current version (1.0.1) only supports <strong>Java</strong> ME<br />

CLDC MIDP. Since it does not support CDC Personal Profile, you can simply create<br />

a regular <strong>Java</strong> project in Eclipse and follow the rules mentioned be<strong>for</strong>e. You may<br />

download one of the Eclipse IDEs <strong>for</strong> <strong>Java</strong> from Eclipse Downloads.<br />

The following tutorial walks you through the process of creating a simple<br />

HelloWorld application in Eclipse. All screenshots were captured using Eclipse IDE<br />

<strong>for</strong> <strong>Java</strong> EE Developers version 3.5 (Galileo), running on Windows XP.<br />

Creating A HelloWorld <strong>Java</strong> Project<br />

This section explains how to create a simple “Hello World” project in the Eclipse<br />

IDE.<br />

To create the project<br />

1 From the menu bar, select File > New > <strong>Java</strong> Project. The New <strong>Java</strong> Project<br />

dialog box appears.<br />

2 In the Project name field, enter HelloWorld.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 11


3 Click Finish.<br />

Note: The Create new project in workspace button specifies that the project<br />

folder will be created under the default Eclipse workspace directory.<br />

Setting Project Compiling Source Level<br />

1 In Package Explorer, right-click the HelloWorld project and choose Properties<br />

in the popup menu. The Properties <strong>for</strong> HelloWorld dialog box appears.<br />

2 In the navigation pane, click the <strong>Java</strong> Compiler node.<br />

3 Uncheck the Use compliance from execution environment ‘<strong>Java</strong>SE-1.6’ on<br />

the <strong>Java</strong> Build Path checkbox.<br />

4 Uncheck the Use default compliance settings check box.<br />

5 Set the Generated .class files compatibility and Source compatibility values<br />

to 1.4. This ensures the generated byte code will be compatible with WEME and<br />

CrE-ME 4.<br />

6 Click OK.<br />

Creating A HelloWorld <strong>Java</strong> Class<br />

1 In Package Explorer, right-click the HelloWorld project and choose New > Class<br />

in the popup menu. The New <strong>Java</strong> Class dialog box appears.<br />

2 In the Package field, enter sample <strong>for</strong> the package name.<br />

3 In the Name field, enter HelloWorld <strong>for</strong> the class name.<br />

12 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


4 In the Superclass field, enter or browse to java.awt.Frame.<br />

5 Click Finish.<br />

Coding the HelloWorld <strong>Java</strong> Class<br />

Copy the following code to the HelloWorld <strong>Java</strong> class and click .<br />

package sample;<br />

import java.awt.*;<br />

import java.awt.event.*;<br />

public class HelloWorld extends Frame {<br />

private Label m_LabelHello = new Label("Hello World!");<br />

private Button m_ButtonClose = new Button("Close");<br />

public HelloWorld(String aTitle)<br />

{<br />

super(aTitle);<br />

initComponents();<br />

}<br />

private void initComponents()<br />

{<br />

add(m_LabelHello, BorderLayout.CENTER);<br />

add(m_ButtonClose, BorderLayout.SOUTH);<br />

m_ButtonClose.addActionListener(new ActionListener()<br />

{<br />

// Invoked when the Close button is clicked.<br />

public void actionPer<strong>for</strong>med(ActionEvent e)<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 13


}<br />

});<br />

{<br />

}<br />

dispose();<br />

System.exit(0);<br />

}<br />

public static void main(String[] args)<br />

{<br />

HelloWorld hwApp = new HelloWorld("Hello World");<br />

hwApp.setSize(200, 200);<br />

hwApp.setVisible(true);<br />

}<br />

This simple application displays the “Hello World!” string in the north of the frame<br />

and a Close button at the south of the frame. Click Close to exit the application.<br />

Exporting to HelloWorld.jar<br />

1 In the Package Explorer, right-click the src folder under HelloWorld and choose<br />

Export from the popup menu.<br />

2 In the Export dialog box, choose JAR file under the <strong>Java</strong> node and click Next.<br />

3 In the JAR File Specification screen, click Browse. The Save As dialog box<br />

appears.<br />

14 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


4 Browse to the HelloWorld project folder, enter HelloWorld.jar in the File<br />

name field, and then click Save.<br />

In the JAR File Specification screen, the JAR file list now includes “HelloWorld/<br />

HelloWorld.jar”. This specifies the output JAR file, HelloWorld.jar, will be<br />

created in the HelloWorld project folder.<br />

To create a runnable JAR, the JAR manifest needs to contain the Main-Class<br />

attribute with the proper main class name. Continue with the next step to create<br />

a runnable JAR, or continue with Step 8 to finish the export.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 15


5 Click Next twice. The JAR Manifest Specification screen appears.<br />

6 Click Browse. The Select Main Class dialog box appears.<br />

7 Select HelloWorld from the list and click OK.<br />

In the JAR Manifest Specification screen, sample.HelloWorld appears in the<br />

Main class field.<br />

8 Click Finish if there are no more changes you wish to make.<br />

16 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


About the JAR Warning Export Message<br />

If you see this JAR Export warning message, click OK and ignore it:<br />

This compile warning appears because the HelloWorld <strong>Java</strong> class does not declare<br />

the “static final long serialVersionUID” field. To avoid the compile warning, define<br />

serialVersionUID properly using the UID obtained from the serialver utility<br />

(included in JDK).<br />

Deploying the HelloWorld Application<br />

To deploy the HelloWorld application, copy HelloWorld.jar to the mobile computer.<br />

If you followed the procedure in ‘‘Exporting to HelloWorld.jar’’ to specify the<br />

main class in the JAR manifest, HelloWorld.jar is a runnable JAR file.<br />

If you have the CrEme JVM installed on your mobile computer, browse to<br />

HelloWorld.jar and tap the filename to run it. To add additional VM options <strong>for</strong><br />

your application, or to run a <strong>Java</strong> application with WEME, you need to create an<br />

application shortcut. For more in<strong>for</strong>mation, see “Creating the Application<br />

Shortcut File” on page 29.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 17


Using the NetBeans IDE<br />

NetBeans IDE has been greatly improved over the years and become a very<br />

competitive open-source IDE. Like Eclipse, NetBeans supports plug-ins to extend<br />

the IDE’s capabilities. One of its great features is its <strong>Java</strong> ME CDC development<br />

support. This section describes how to create a CDC Personal Profile 1.0 application<br />

in NetBeans.<br />

All screenshots in this section were captured using NetBeans 6.8 running on<br />

Windows XP. You may download NetBeans from the NetBeans Download site.<br />

There are different bundles of NetBeans you can choose to download. <strong>Intermec</strong><br />

recommends that you choose a bundle which includes <strong>Java</strong> ME.<br />

18 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


Installing the <strong>Java</strong> ME Plug-in<br />

If you did not choose a NetBeans bundle that includes <strong>Java</strong> ME, you need to install<br />

the <strong>Java</strong> ME Plug-in. You may check the current plug-ins installed in NetBeans.<br />

From the menu bar, select Tools > Plug-ins. In the Plug-ins dialog box, click the<br />

Installed tab to show the list of installed plug-ins. Make sure <strong>Java</strong> ME is in the list. If<br />

you do not see <strong>Java</strong> ME in the list, install it from the Available Plug-ins tab.<br />

Installing a CDC Emulator Plat<strong>for</strong>m<br />

An emulator plat<strong>for</strong>m provides the SDK and emulation environment <strong>for</strong> you to<br />

build and test <strong>for</strong> the target plat<strong>for</strong>m. The NetBeans web site provides the CDC<br />

Emulator Plat<strong>for</strong>m Setup Guide <strong>for</strong> the supported CDC emulators. Currently the<br />

best matched emulator is the CrEme emulator. This emulator emulates the CrE-ME<br />

4 VM. If you are already using CrE-ME 4 on your mobile computer, this is a perfect<br />

match. Even if your target JVM is WEME, the generated .class files will be<br />

compatible since CrE-ME 4 is compliant with CDC/Personal Profile 1.0. However,<br />

you should avoid the Swing classes which are only supported in CrE-ME.<br />

Note: If your target JVM is WEME and you need the APIs in Personal Profile 1.1 that<br />

are not supported by the CrEme emulator, create a regular <strong>Java</strong> application project<br />

and observe the rules described in “About the Integrated Development<br />

Environment” on page 10.<br />

To install the CrEme emulator<br />

1 Download CrEmeDevSup410.exe from NSIcom.<br />

2 Run the file and follow the prompts to install the Developer Kit.<br />

3 In the NetBeans IDE menu bar, select Tools > <strong>Java</strong> Plat<strong>for</strong>ms.<br />

4 In the <strong>Java</strong> Plat<strong>for</strong>m Manager dialog box, click Add Plat<strong>for</strong>m.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 19


5 In the Add <strong>Java</strong> Plat<strong>for</strong>m dialog box, select <strong>Java</strong> ME CDC Plat<strong>for</strong>m Emulator<br />

and click Next.<br />

6 In the Choose Plat<strong>for</strong>m Folder screen, browse to the installation folder of the<br />

CrE-ME Developer Kit (default is “C:\Program Files\NSIcom\CrE-ME V4.12”)<br />

and then click Next.<br />

20 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


7 In the Plat<strong>for</strong>m Name screen, click Finish.<br />

A new plat<strong>for</strong>m entry is added to the CDC node in the <strong>Java</strong> Plat<strong>for</strong>m Manager<br />

dialog box.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 21


Creating a HelloWorld Project<br />

1 In the NetBeans menu bar, select File > New Project. The New Project dialog<br />

box appears.<br />

2 In the Choose Project screen, choose <strong>Java</strong> ME in the Categories list, choose CDC<br />

Application in the Projects list, and then click Next.<br />

3 In the Name and Location screen:<br />

a In the Project Name field, enter HelloWorld.<br />

b In the Project Location field, enter the path to (or browse to) the project<br />

location, or accept the default location.<br />

c Uncheck the Create Main Class check box.<br />

d Click Next.<br />

22 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


4 In the Select Plat<strong>for</strong>m section, choose pJSCP V4.12 B142.190307 from the <strong>Java</strong><br />

Plat<strong>for</strong>m list and then click Finish.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 23


Creating a HelloWorld Class<br />

1 In the Projects window, right-click the HelloWorld project and choose New ><br />

<strong>Java</strong> Class from the popup menu. The New <strong>Java</strong> Class dialog box appears.<br />

2 In the Class Name field, enter HelloWorld.<br />

3 In the Package field, enter sample.<br />

4 Click Finish.<br />

Coding the HelloWorld <strong>Java</strong> Class<br />

Copy the following code to the HelloWorld <strong>Java</strong> class and click .<br />

package sample;<br />

import java.awt.*;<br />

import java.awt.event.*;<br />

public class HelloWorld extends Frame {<br />

private Label m_LabelHello = new Label("Hello World!");<br />

private Button m_ButtonClose = new Button("Close");<br />

public HelloWorld(String aTitle)<br />

{<br />

super(aTitle);<br />

initComponents();<br />

}<br />

private void initComponents()<br />

{<br />

add(m_LabelHello, BorderLayout.CENTER);<br />

add(m_ButtonClose, BorderLayout.SOUTH);<br />

m_ButtonClose.addActionListener(new ActionListener()<br />

{<br />

// Invoked when the Close button is clicked.<br />

24 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


}<br />

});<br />

public void actionPer<strong>for</strong>med(ActionEvent e)<br />

{<br />

dispose();<br />

System.exit(0);<br />

}<br />

}<br />

public static void main(String[] args)<br />

{<br />

HelloWorld hwApp = new HelloWorld("Hello World");<br />

hwApp.setSize(200, 200);<br />

hwApp.setVisible(true);<br />

}<br />

This simple application displays the “Hello World!” string in the north of the frame<br />

and a Close button at the south of the frame. Click Close to exit the application.<br />

Building the HelloWorld Project<br />

• In the Projects window, right-click the HelloWorld project and choose Build in<br />

the popup menu.<br />

The build process begins and you see the build results in the Output window. If the<br />

build is successful, you can find HelloWorld.jar in the dist subfolder of the<br />

HelloWorld project folder.<br />

Running HelloWorld in Emulator<br />

You can test the HelloWorld application in the CrEme emulator be<strong>for</strong>e deploying<br />

the application to your mobile computer. The emulator can only run a runnable<br />

JAR. A runnable JAR contains a Main-Class attribute in the JAR manifest. The<br />

following will show you how to specify the main class name in the project settings<br />

and run the HelloWorld application in the CrEme emulator.<br />

1 In the Projects window, right-click the HelloWorld project and choose<br />

Properties in the popup menu. The HelloWorld properties dialog box appears.<br />

2 In the Build category choose Running.<br />

3 In the CDC Run tab, click Browse. The Browse Main Classes dialog box appears.<br />

The main classes in the project are shown in the Main classes list.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 25


4 Choose sample.HelloWorld from the list box and then click Select Main Class.<br />

5 In the HelloWorld properties dialog box, make sure that sample.HelloWorld<br />

appears in the Main Class field of the CDC Run tab.<br />

6 Click OK.<br />

7 In the Projects window, right-click the HelloWorld project and choose Run in<br />

the popup menu. The IDE rebuilds the project and runs the HelloWorld<br />

application in the CrEme emulator.<br />

26 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


Deploying the HelloWorld Application to CrE-ME<br />

If you have CrE-ME 4 on your mobile computer, you can launch the application<br />

directly from NetBeans via ActiveSync.<br />

To run the HelloWorld application in the remote CrE-ME VM<br />

1 In the Projects window, right click the HelloWorld project and choose<br />

Properties from the popup menu. The Hello World properties dialog box<br />

appears.<br />

2 In the navigation pane, choose the Running node in the Build category.<br />

3 Click the CDC Run tab. The Main Class field must be specified. If it is not<br />

already specified, use Browse to select a main class in the project. For the<br />

HelloWorld application, the main class is sample.HelloWorld.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 27


4 Click the NSIcom tab in the right pane.<br />

5 Check the Run in remote VM check box.<br />

6 By default, the application JAR file (HelloWorld.jar) is deployed to the “\My<br />

Documents\NetBeans <strong>Applications</strong>” folder on the mobile computer. To deploy<br />

the application to a different location, change in<strong>for</strong>mation in the Application<br />

Location field.<br />

7 Click OK.<br />

8 In the Projects window, right-click the HelloWorld project and choose Run from<br />

the popup menu. NetBeans builds and deploys the HelloWorld.jar to the mobile<br />

computer and runs the application. The HelloWorld UI appears on your mobile<br />

computer.<br />

Deploying the HelloWorld Application to WEME<br />

Although NetBeans 6.8 supports a deployment option called “Windows Mobile<br />

Deployment (locally attached device)” <strong>for</strong> CDC projects, the ANT script requires<br />

deploying the JAD file along with the JAR file. Because the CDC project does not<br />

produce the JAD file, the script would fail. There<strong>for</strong>e, if you have WEME on your<br />

mobile computer, you need to manually deploy the application. To manually copy<br />

the necessary JAR files and the application shortcut to the mobile computer, see the<br />

next section, “Deploying <strong>Applications</strong>.”<br />

28 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


Deploying <strong>Applications</strong><br />

Deploying your <strong>Java</strong> application to <strong>Intermec</strong> mobile computer generally involves<br />

copying the application JAR files and the application shortcut file to the mobile<br />

computer.<br />

Creating the Application Shortcut File<br />

The application shortcut specifies the command line arguments to run an<br />

application. Windows Mobile and CE computers have the following requirements<br />

<strong>for</strong> the shortcut file:<br />

• The file must have a file extension of .lnk.<br />

• The file must contain only one line of text (up to 255 characters).<br />

• The line begins with nnn# followed by the command line arguments, where nnn<br />

is a number up to 3 digits specifying the number of characters in the command<br />

line. Because the exact number does not seem to matter <strong>for</strong> Windows Mobile/CE,<br />

use 255# <strong>for</strong> all shortcuts.<br />

The command line you specify in the shortcut file depends on the JVM. Generally,<br />

you should specify the VM executable followed by the VM options and classpath, the<br />

application main class name, and application arguments. Using the HelloWorld<br />

example we created earlier, the shortcut file should look like the following:<br />

HelloWorld-WEME6-PPRO11.lnk <strong>for</strong> WEME 6.2 Personal Profile 1.1<br />

255#"\J9\PPRO11\bin\j9.exe" "-jcl:ppro11" "-classpath" "\Program<br />

Files\HelloWorld\HelloWorld.jar" "sample.HelloWorld"<br />

HelloWorld-CrEME4.lnk <strong>for</strong> CrE-ME 4 Personal Profile 1.0<br />

255#"\windows\CrEme\bin\CrEme.exe" -Of -classpath '\Program<br />

Files\HelloWorld\HelloWorld.jar' sample.HelloWorld<br />

Note: Although you may see multiple lines in the above examples, there is only one<br />

line of text in the shortcut file.<br />

For more in<strong>for</strong>mation regarding the specific VM options, refer to your JVM<br />

documentation.<br />

Copying Files to the Mobile Computer<br />

To run your application on the mobile computer, you need to copy the necessary<br />

files to the computer. The files usually include the application JAR file, its<br />

dependent library JAR files, and the application shortcut. You may copy the files<br />

from your development machine to the mobile computer via ActiveSync or some<br />

other mechanism.<br />

For the HelloWorld example, you need to copy the HelloWorld.jar to the “\Program<br />

Files\HelloWorld” folder on the mobile computer.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 29


Running the Application<br />

Note: The file path must match the classpath you specified in the shortcut file. You<br />

may copy the shortcut file anywhere on the device. For ease of maintenance, place<br />

the shortcut file in the same folder as the application JAR files.<br />

On your mobile computer, open File Explorer to browse to the application shortcut.<br />

For WEME, a purple WebSphere icon appears next to the WEME application<br />

shortcut. Tap the shortcut to run the application.<br />

CrE-ME associates the .JAR file and CrE-ME shortcut file with a yellow NSIcom<br />

icon. If the JAR file is a runnable JAR, you can tap the JAR file to launch it in the<br />

CrE-ME JVM. You may also launch the application from a shortcut file containing<br />

CrE-ME specific VM options.<br />

Remote Debugging<br />

Tip: If you get java.lang.NoClassDefFoundError exception when you run the<br />

application, double-check the classpath and the main class name you specified in<br />

the shortcut. Make sure the JAR files exist in the specified location on the mobile<br />

computer.<br />

Remote debugging is possible if the JVM on the mobile computer and the IDE<br />

support <strong>Java</strong> Plat<strong>for</strong>m Debugger Architecture (JPDA). Both the Eclipse and<br />

NetBeans IDEs support remote debugging via JPDA. The IDE debugger can attach<br />

to a remote <strong>Java</strong> application via JDPA transport.<br />

Although WEME supports remote debugging, CrE-ME 4 does not. This section<br />

walks you through the setup process to debug a <strong>Java</strong> application running in WEME<br />

from either the Eclipse or NetBeans IDE. The common tasks involved in setting up<br />

remote debugging are as follows:<br />

1 Create an application shortcut that specifies debug options.<br />

2 Deploy the application with the debug shortcut and start the debug session.<br />

3 Set up the IDE JPDA transport to attach to the remote application.<br />

The following sections provide more details <strong>for</strong> these tasks. Two separate tutorials<br />

are provided <strong>for</strong> the Eclipse and NetBeans IDEs.<br />

30 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


Creating a Shortcut <strong>for</strong> Debugging<br />

To start remote debugging, the application needs to be started in debug mode,<br />

which requires additional debug options to be added to the application shortcut.<br />

Using the HelloWorld application created in ‘‘About the Integrated Development<br />

Environment’’ as an example, the following text shows the contents of the shortcut<br />

<strong>for</strong> debugging (all in one line).<br />

225#"\J9\PPRO11\bin\j9.exe" "-jcl:ppro11" "-Xdebug"<br />

"-Xrunjdwp:transport=dt_socket,server=y,address=8000"<br />

"-classpath" "\Program Files\HelloWorld\HelloWorld.jar"<br />

"sample.HelloWorld"<br />

Note the italicized debug options. The following explains the settings specified in<br />

the “–Xrunjdwp” option. The IDE debugger settings need to match these settings.<br />

• The transport=dt_socket setting specifies the debugger connection will be made via<br />

JPDA socket transport.<br />

• The server=y setting specifies the VM will wait <strong>for</strong> the remote debugger (IDE) to<br />

attach at the port number specified in the address setting.<br />

• The address=8000 setting specifies the port number (8000) on which the VM is<br />

waiting <strong>for</strong> the remote debugger (IDE) to attach.<br />

Deploying and Starting a Debug Session<br />

Follow the steps in this section to deploy and launch the HelloWorld application<br />

with the debug shortcut created in the previous section. These steps are similar to<br />

those described in “Deploying <strong>Applications</strong>.”<br />

1 Save the shortcut created in ‘‘Creating a Shortcut <strong>for</strong> Debugging’’ in a file<br />

called HelloDbg-WEME6-PPRO11.lnk.<br />

2 Copy both HelloWorld.jar and HelloDbg-WEME6-PPRO11.lnk to the “\Program<br />

Files\HelloWorld” folder on the mobile computer.<br />

3 On the mobile computer, browse to the “\Program Files\HelloWorld” folder. Tap<br />

on HelloDbg-WEME6-PPRO11.lnk to start the debug session.<br />

Since we specified J9.exe in the shortcut, the J9 console appears on the mobile<br />

computer:<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 31


Remote Debugging in Eclipse<br />

The application does not start until the remote debugger attaches. The next<br />

sections explain how to attach to the debug session from the Eclipse or NetBeans<br />

IDE.<br />

This section explains how to remotely debug the HelloWorld application in Eclipse.<br />

Be<strong>for</strong>e you begin this section, follow the instructions in ‘‘Creating a Shortcut <strong>for</strong><br />

Debugging’’ and “Deploying and Starting a Debug Session.”<br />

Setting Breakpoints<br />

You can set breakpoints in the HelloWorld class be<strong>for</strong>e you launch the IDE<br />

debugger. For example, you can set a breakpoint in the HelloWorld class at the<br />

dispose() method in the actionPer<strong>for</strong>med method of the listener <strong>for</strong> the Close<br />

button.<br />

Setting and Starting the IDE Debugger<br />

1 In the Package Explorer, choose the HelloWorld application.<br />

2 In the menu bar, choose Run > Debug Configurations. The Debug<br />

Configurations dialog box appears.<br />

3 In the navigation pane, click the Remote <strong>Java</strong> Application node.<br />

4 Click (above the navigation pane) to create a new configuration.<br />

Configuration settings appear in the right pane. Most of the fields are<br />

automatically populated. You can verify them in the following steps.<br />

5 Specify a name in the Name field if it is not automatically populated.<br />

6 In the Project field, browse to the HelloWorld project if it is not already selected.<br />

7 In the Connection Type list, choose Standard (Socket Attach).<br />

8 In the Host field, enter 169.254.2.1 if your mobile computer is connected to<br />

your PC via ActiveSync. You can specify another IP address as long as it is<br />

reachable from your PC.<br />

Note: For Windows Mobile 5 computers connected via ActiveSync, you need to<br />

double check the USB to PC setting. On the mobile computer, select Start ><br />

Settings > the Connections tab > the USB to PC applet. Make sure the Enable<br />

advanced network functionality check box is checked. For Windows Mobile 6.1<br />

computers, this check box is checked by default. ActiveSync will not work if it is<br />

unchecked.<br />

9 In the Port field, enter 8000.<br />

Note: The port number needs to match what you specified in the address setting<br />

in the –Xrunjdwp option of your application shortcut. For more in<strong>for</strong>mation, see<br />

“Creating a Shortcut <strong>for</strong> Debugging” on page 31.<br />

32 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


10 Click Apply to save the settings, or click Debug to save the settings and start<br />

debugging.<br />

As soon as the debugger attaches to the remote VM, the application begins to<br />

run. On the mobile computer, WEME (J9) launches the HelloWorld UI unless<br />

there are breakpoints be<strong>for</strong>e the UI is displayed.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 33


As seen in the following screenshot, the debugger sets a breakpoint at the<br />

dispose() method in the actionPer<strong>for</strong>med method of the listener <strong>for</strong> the Close<br />

button. When the Close button is clicked in the HelloWorld UI, the debugger<br />

breaks at the dispose() method.<br />

Remote Debugging in NetBeans<br />

This section walks you through the process of remotely debugging the HelloWorld<br />

application in NetBeans. Be<strong>for</strong>e you begin this section, follow the instructions in<br />

‘‘Creating a Shortcut <strong>for</strong> Debugging’’ and “Deploying and Starting a Debug<br />

Session.”<br />

Setting Breakpoints<br />

You may set some breakpoints in the HelloWorld class be<strong>for</strong>e you launch the IDE<br />

debugger. For example, you may set a breakpoint in the HelloWorld class at the<br />

dispose() method in the actionPer<strong>for</strong>med method of the listener <strong>for</strong> the Close<br />

button.<br />

34 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


Setting and Starting IDE Debugger<br />

1 In the Projects window, choose the HelloWorld project.<br />

2 In the menu bar, choose Debug > Attach Debugger. The Attach dialog box<br />

appears.<br />

3 In the Debugger drop-down list, choose <strong>Java</strong> Debugger (JPDA).<br />

4 In the Connector drop-down list, choose SocketAttach (Attaches by socket to<br />

other VMs).<br />

5 In the Host field, enter 169.254.2.1 if your mobile computer is connected to<br />

your PC via ActiveSync. You may specify another IP address as long as it is<br />

reachable from your PC.<br />

Note: For Windows Mobile 5 computers connected via ActiveSync, you need to<br />

double check the USB to PC setting. On the mobile computer, select Start ><br />

Settings > the Connections tab > the USB to PC applet. Make sure the Enable<br />

advanced network functionality check box is checked. For Windows Mobile 6.1<br />

computers, this check box is checked by default. ActiveSync will not work if it is<br />

unchecked.<br />

6 In the Port field, enter 8000.<br />

Note: The port number needs to match what you specified in the address setting<br />

in the –Xrunjdwp option of your application shortcut. For more in<strong>for</strong>mation, see<br />

“Creating a Shortcut <strong>for</strong> Debugging” on page 31.<br />

7 Click OK to start debugging.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 35


As soon as the debugger attaches to the remote VM, the application runs. On the<br />

mobile computer, WEME (J9) launches the HelloWorld UI, unless there are<br />

breakpoints be<strong>for</strong>e the UI is displayed.<br />

As seen in the next screenshot, it sets a breakpoint at the dispose() method in the<br />

actionPer<strong>for</strong>med method of the listener <strong>for</strong> the Close button. When the Close<br />

button is clicked in the HelloWorld UI, the debugger breaks at the dispose() method.<br />

36 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


Accessing Databases Using JDBC<br />

JDBC Sample Application<br />

package sample;<br />

import java.sql.*;<br />

public class JDBCSample {<br />

public static void main(String[] args)<br />

{<br />

String url = "jdbc:db2e:mydb";<br />

Connection con = null;<br />

Statement st = null;<br />

ResultSet rs = null;<br />

The JDBC API enables <strong>Java</strong> applications to access SQL-based databases or tabular<br />

data sources. JSR 169 defines a JDBC Optional Package <strong>for</strong> <strong>Java</strong> ME CDC. Note that<br />

JSR 169 only provides a subset of the JDBC 4.0 API in <strong>Java</strong> SE 6. WEME 6.2 includes<br />

the JDBC optional package that implements JSR 169. CrE-ME also has support <strong>for</strong><br />

JDBC but it is not clear whether it implements JSR 169.<br />

<strong>Java</strong> SE supports two ways to connect to the database via the DriverManager class or<br />

the DataSource interface. JSR 169 only supports the DataSource interface. The code<br />

will work in both WEME and CrEme if you use a vendor specific DataSource object<br />

to connect to the database.<br />

Note: Currently the database vendors such as IBM and Oracle only support JDBC<br />

drivers to access local databases, and provide data synchronization between the local<br />

and the remote server databases.<br />

This sample application connects to an IBM DB2 Everyplace (DB2e) database via<br />

the com.ibm.db2e.jdbc.DB2eDataSource object that implements the<br />

javax.sql.DataSource interface. The URL string “jdbc:db2e:mydb” identifies a data<br />

source. Note that the URL <strong>for</strong>mat may be vendor specific.<br />

try<br />

{<br />

// DB2eDataSource is in db2ejdbc.jar which is included in the<br />

// DB2e installation CAB file.<br />

com.ibm.db2e.jdbc.DB2eDataSource ds = new com.ibm.db2e.jdbc.DB2eDataSource();<br />

ds.setUrl(url);<br />

con = ds.getConnection();<br />

st = con.createStatement();<br />

// Creates a table called INVENTORY.<br />

st.executeUpdate("CREATE TABLE INVENTORY (ITEM VARCHAR(32), QTY INT)");<br />

System.out.println("*** Created table: INVENTORY");<br />

// Inserts records to the INVENTORY table.<br />

st.executeUpdate("INSERT INTO INVENTORY VALUES ('9780201',3)");<br />

st.executeUpdate("INSERT INTO INVENTORY VALUES ('9780672',10)");<br />

System.out.println("*** Inserted two records");<br />

// Queries the INVENTORY table.<br />

rs = st.executeQuery("SELECT * FROM INVENTORY");<br />

System.out.println("*** Query results:");<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 37


}<br />

}<br />

while (rs.next())<br />

{<br />

System.out.print("ITEM=" + rs.getString(1) + ", ");<br />

System.out.println("QTY=" + rs.getInt(2));<br />

}<br />

// Since this is only an example, delete the INVENTORY table.<br />

st.executeUpdate("Drop table INVENTORY");<br />

System.out.println("*** Deleted table: INVENTORY");<br />

}<br />

catch (Exception e)<br />

{<br />

e.printStackTrace();<br />

}<br />

finally<br />

{<br />

// Releases resources.<br />

try {<br />

if (rs != null) rs.close();<br />

} catch (Exception e) {e.printStackTrace();}<br />

}<br />

try {<br />

if (st!= null) st.close();<br />

} catch (Exception e) {e.printStackTrace();}<br />

try {<br />

if (con != null) con.close();<br />

} catch (Exception e) {e.printStackTrace();}<br />

Building the Sample<br />

Running the Sample<br />

To build this sample, follow the rules in “About the Integrated Development<br />

Environment” on page 10. Note that the JDBCSample refers to the<br />

com.ibm.db2e.jdbc.DB2eDataSource class which is in db2ejdbc.jar. The<br />

db2ejdbc.jar file is included in the DB2e installation. You need to add db2ejdbc.jar<br />

as an external JAR to the IDE project, or include db2ejdbc.jar in the classpath if you<br />

use the javac compiler from command line.<br />

To deploy and run this sample on the mobile computer, see the instructions in<br />

“Deploying <strong>Applications</strong>” on page 29. The application shortcut to run this<br />

sample in WEME may look like the following:<br />

255#"\J9\PPRO11\bin\j9.exe" "-jcl:ppro11" -<br />

Djava.library.path=\Windows -classpath "\Program<br />

Files\JDBCSample\JDBCSample.jar;\Windows\db2ejdbc.jar"<br />

"sample.JDBCSample"<br />

Note that it specifies the “-Djava.library.path=\Windows” option which is required<br />

in order <strong>for</strong> WEME to load the DB2e’s native DLLs. This shortcut assumes the<br />

JDBCSample.class is packaged in JDBCSample.jar which is located in the “\Program<br />

Files\JDBCSample” folder on the mobile computer.<br />

38 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


This sample application simply outputs to the console. The J9 console displays the<br />

following text when you run the application.<br />

You can also run this sample in CrE-ME. The following is a shortcut <strong>for</strong> CrE-ME 4:<br />

255#"\windows\CrEme\bin\CrEme.exe" -Of -classpath '\Program<br />

Files\JDBCSample\JDBCSample.jar;\Windows\db2ejdbc.jar'<br />

sample.JDBCSample<br />

Note: The “-Of” option specifies the output will be redirected to jscpout.txt located<br />

at the root folder of the mobile computer.<br />

Adapting the Sample <strong>for</strong> Other DBMS<br />

You can easily change the DataSource related code in the JDBCSample to connect to<br />

a different DBMS. The following is the code snippet to connect to an Oracle<br />

Database Lite database.<br />

String url = "jdbc:polite:polite";<br />

oracle.lite.poljdbc.POLJDBCDataSource ds = new<br />

oracle.lite.poljdbc.POLJDBCDataSource();<br />

ds.setUrl(url);<br />

ds.setUser("SYSTEM");<br />

ds.setPassword("MANAGER");<br />

It instantiates the oracle.lite.poljdbc.POLJDBCDataSource object and sets up the<br />

data source url “jdbc:polite:polite”. It also sets the username and password to access<br />

the database. Once you made these changes, the rest of the code in JDBCSample<br />

should work fine with the Oracle Lite database.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 39


<strong>Developing</strong> a Web Services Client<br />

Web services are APIs that can be accessed over a network regardless of systems and<br />

languages, and are best used to integrate heterogeneous systems. Although it is<br />

beyond the scope of this document to discuss when or why you should use this<br />

technology, if you decide to deploy web services this section shows you how to<br />

develop a mobile application to consume web services.<br />

The web services client development usually involves generating stub classes from<br />

the Web Services Definition Language (WSDL). The stub classes allow the client to<br />

access the web services APIs via <strong>Java</strong> classes and methods and hide the complexity of<br />

encoding and decoding the SOAP messages. Although there are a lot of tools that<br />

generate web services stubs, we need to consider the web services supported on the<br />

mobile computers.<br />

JSR 172 is the specification that defines an optional package <strong>for</strong> <strong>Java</strong> ME<br />

applications to access web services. Currently both WEME 6.2 and CrE-ME 4.12 do<br />

not provide implementation <strong>for</strong> JSR 172. An implementation of JSR 172 that is<br />

compatible with <strong>Java</strong> ME CDC is required to support the web services development<br />

and deployment.<br />

Sun Microsystems, now a subsidiary of Oracle Corporation, implemented JSR 172<br />

in its <strong>Java</strong> Wireless Toolkit 2.5.2 and <strong>Java</strong> ME SDK 3.0. Both implementations target<br />

<strong>Java</strong> ME CLDC/MIDP. Although the <strong>Java</strong> Wireless Toolkit has been integrated into<br />

the <strong>Java</strong> ME SDK 3.0, jsr172_1.0.jar in <strong>Java</strong> ME SDK 3.0 causes runtime errors<br />

during testing with WEME 6.2. Because the <strong>Java</strong> Wireless Toolkit implementation of<br />

JSR 172 works better with CDC, <strong>Intermec</strong> recommends that you use <strong>Java</strong> Wireless<br />

Toolkit 2.5.2. To follow the tutorials in this section, you need to download and<br />

install sun_java_wireless_toolkit-2.5.2_01-win.exe from the Sun <strong>Java</strong> Wireless<br />

Toolkit 2.5.2_01 <strong>for</strong> CLDC Download web site.<br />

The following sections will walk you through the development process of creating a<br />

web services client to consume a web service hosted by www.webservicex.net. Two<br />

separate tutorials are offered <strong>for</strong> developing in Eclipse or NetBeans.<br />

Note: The web services example used in this section was tested against WEME 6.2<br />

and CrE-ME 4.12. Although it seems to get the expected result, it takes a long time<br />

(several minutes) <strong>for</strong> the web service call to return a response when running in CrE-<br />

ME. It only takes a few seconds to get the response in WEME.<br />

<strong>Developing</strong> a Web Services Client in Eclipse<br />

There is no Eclipse plug-in that supports Web Services development <strong>for</strong> <strong>Java</strong> ME<br />

CDC. This tutorial uses the Sun <strong>Java</strong> Wireless Toolkit to generate the web services<br />

stubs and import them into Eclipse. If you have not already installed <strong>Java</strong> Wireless<br />

Toolkit, download sun_java_wireless_toolkit-2.5.2_01-win.exe from the Sun <strong>Java</strong><br />

Wireless Toolkit 2.5.2_01 <strong>for</strong> CLDC Download web page and install it on your<br />

PC.<br />

40 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


The following is a summary of the development process.<br />

1 Create an Eclipse <strong>Java</strong> project and add the web services JAR files from the <strong>Java</strong><br />

Wireless Toolkit as external JARs.<br />

2 Adjust the project compiling source level.<br />

3 Use the Sun <strong>Java</strong> Wireless Toolkit to generate the web services stubs.<br />

4 Import the generated stubs to the Eclipse project.<br />

5 Create a <strong>Java</strong> class to call the web services API via the stub.<br />

6 Export the application class files to a JAR.<br />

7 Deploy the application to an <strong>Intermec</strong> mobile computer.<br />

Creating a StockQuoteWTK <strong>Java</strong> Project<br />

1 In the Eclipse IDE, select File > New > Project.<br />

2 In the New Project dialog box, choose <strong>Java</strong> Project and click Next.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 41


3 In the Project name field, enter StockQuoteWTK and click Next.<br />

4 In the <strong>Java</strong> Settings screen, choose the Libraries tab and click Add External<br />

Jars. The JAR Selection dialog box appears. Browse to the lib subfolder of the<br />

<strong>Java</strong> Wireless Toolkit installation folder.<br />

42 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


5 Choose j2me-ws.jar and j2me-xmlrpc.jar and click Open.<br />

The JARs and class folders on the build path list in the Libraries tab now<br />

includes the JARs you selected.<br />

6 Click Finish to save the project settings.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 43


Setting the Project Compiling Source Level<br />

1 In the Package Explorer, right click the StockQuoteWTK project and choose<br />

Properties in the popup menu. The Properties <strong>for</strong> StockQuoteWTK dialog box<br />

appears.<br />

2 In the navigation pane, choose <strong>Java</strong> Compiler.<br />

3 Uncheck the Use compliance from execution environment ‘<strong>Java</strong>SE-1.6’ on<br />

the <strong>Java</strong> Build Path check box.<br />

4 Uncheck the Use default compliance settings check box.<br />

5 Set both Generated .class files compatibility and Source compatibility to 1.4.<br />

This ensures the generated byte code will be compatible with WEME and CrE-<br />

ME 4.<br />

6 Click OK to accept the changes.<br />

Generating Web Services Stubs<br />

This tutorial uses the Sun <strong>Java</strong> Wireless Toolkit 2.5.2 to generate the web services<br />

stubs. There should be a shortcut on the desktop <strong>for</strong> the Wireless Toolkit. If you<br />

don’t see the desktop shortcut, browse to the “bin” subfolder of the Wireless Toolkit<br />

installation folder and run ktoolbar.exe.<br />

44 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


This screen appears after the Wireless Toolkit is started:<br />

To generate the web services stubs<br />

1 Click New Project. The New Project dialog box appears.<br />

2 In the Project Name field, enter StockQuote and click Create Project. The API<br />

Selection dialog box appears.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 45


3 Click OK.<br />

4 In the menu bar, choose Project > Stub Generator.<br />

5 In the Stub Generator Dialog, do the following:<br />

a In the WSDL Filename or URL field, enter http://<br />

www.webservicex.net/stockquote.asmx?wsdl.<br />

b In the Output Package field, enter test.stub. This field specifies the<br />

package name that the stub classes will be generated under.<br />

c Click OK.<br />

Note: When the stub generation is successfully completed, the generated <strong>Java</strong><br />

classes appear in the indicated Output Path.<br />

46 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


6 Locate the generated <strong>Java</strong> classes. We will import these classes to Eclipse later.<br />

Importing Generated Stub Classes to Eclipse<br />

1 In the Eclipse Package Explorer, right-click the StockQuoteWTK project and<br />

choose Import in the popup menu. The Import dialog box appears.<br />

2 In the Select an import source list, choose General > File System and click<br />

Next.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 47


3 In the File system screen:<br />

a<br />

b<br />

c<br />

Click Browse and browse to the folder where the stubs were generated. This<br />

example selects the src folder that contains the test\stub subfolder. Make<br />

sure the src checkbox is checked.<br />

In the Into folder entry field, type StockQuoteWTK\src.<br />

Click Finish.<br />

If the stub classes are successfully imported, they are included under the src folder of<br />

the StockQuoteWTK project node.<br />

48 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


Creating a <strong>Java</strong> Class to Call the Web Services API<br />

1 In the Eclipse Package Explorer, right-click the StockQuoteWTK project and<br />

choose New > Class from the popup menu. The New <strong>Java</strong> Class dialog box<br />

appears.<br />

2 In the Name field, enter StockQuoteMain.<br />

3 Check the public static void main(String[] args) check box to generate the<br />

main method.<br />

4 Click Finish.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 49


package test;<br />

import test.stub.*;<br />

Source Code <strong>for</strong> StockQuoteMain<br />

In the source code viewer of StockQuoteMain, enter the following code. Click<br />

save the changes.<br />

to<br />

/**<br />

* Simple class to test the web services stub generated by Sun <strong>Java</strong><br />

* Wireless Toolkit 2.5.2.<br />

*/<br />

public class StockQuoteMain {<br />

/**<br />

* @param args<br />

*/<br />

public static void main(String[] args)<br />

{<br />

String sSymbol = null; // Stock symbol<br />

if (args.length > 0)<br />

{<br />

sSymbol = args[0];<br />

}<br />

else<br />

{<br />

sSymbol = "IN"; // Default to <strong>Intermec</strong> symbol.<br />

}<br />

}<br />

}<br />

try<br />

{<br />

System.out.println("Making web services call...");<br />

StockQuoteSoap_Stub stub = new StockQuoteSoap_Stub();<br />

String sQuoteXML = stub.getQuote(sSymbol);<br />

System.out.println("sQuote=" + sQuoteXML);<br />

// Get the value between and <br />

int indStart = sQuoteXML.indexOf("");<br />

int indEnd = sQuoteXML.indexOf("");<br />

if (indStart >= 0 && indEnd >= 0)<br />

{<br />

String sLatestValue = sQuoteXML.substring(<br />

indStart+6, indEnd);<br />

System.out.println("Quote=" + sLatestValue);<br />

}<br />

else<br />

{<br />

System.out.println("Missing tag in response");<br />

}<br />

}<br />

catch (Exception e)<br />

{<br />

e.printStackTrace();<br />

}<br />

50 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


Programming Notes<br />

The stock symbol is passed in as the first program argument. The default is “IN” if<br />

not specified. It calls the StockQuoteSoap_Stub.getQuote method to get the<br />

current quote. Note that this method returns an XML string. You can use the kXML<br />

library to parse the XML. The above code uses methods in String to retrieve the<br />

value between the and tags.<br />

Exporting Classes to StockQuoteWTK.jar<br />

1 In the Eclipse Package Explorer, right-click the src folder under the<br />

StockQuoteWTK project and choose Export from the popup menu. The Export<br />

dialog box appears.<br />

2 In the Select an export destination list, choose <strong>Java</strong> > JAR file and click Next.<br />

3 In the JAR File Specification screen, click Browse. The Save As dialog box<br />

appears.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 51


4 Browse to the StockQuoteWTK project folder, enter StockQuoteWTK.jar in<br />

the File name field, and click Save.<br />

5 The JAR file list in the JAR File Specification screen now shows<br />

“StockQuoteWTK/StockQuoteWTK.jar”. This specifies that the output JAR file,<br />

StockQuoteWTK.jar, will be created under the StockQuoteWTK project folder.<br />

6 Click Finish to generate the JAR file.<br />

52 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


Deploying the Web Services Client to the Mobile<br />

Computer<br />

This section describes how to deploy the StockQuoteWTK web services client<br />

application to the mobile computer. It also follows the guidelines described in<br />

“Deploying <strong>Applications</strong>” on page 29.<br />

Creating an Application Shortcut<br />

Create a WEME or CrE-ME shortcut like the following:<br />

StockQuoteWTK-WEME6-PPRO11.lnk <strong>for</strong> WEME 6.2 Personal Profile 1.1<br />

255#"\J9\PPRO11\bin\j9.exe" "-jcl:ppro11" "-classpath"<br />

"\StockQuoteWTK\j2me-ws.jar;\StockQuoteWTK\j2mexmlrpc.jar;\StockQuoteWTK\StockQuoteWTK.jar"<br />

test.StockQuoteMain<br />

StockQuoteWTK-CrEME4.lnk <strong>for</strong> CrE-ME 4 Personal Profile 1.0<br />

255#"\windows\CrEme\bin\CrEme.exe" -Of -classpath<br />

'\StockQuoteWTK\j2me-ws.jar;\StockQuoteWTK\j2mexmlrpc.jar;\StockQuoteWTK\StockQuoteWTK.jar'<br />

test.StockQuoteMain<br />

Copying Files to the Mobile Computer<br />

1 In the root directory of the mobile computer, create a folder called<br />

StockQuoteWTK.<br />

2 Copy StockQuoteWTK.jar (as generated in ‘‘Exporting Classes to<br />

StockQuoteWTK.jar’’) to the mobile computer \StockQuoteWTK folder.<br />

3 Depending on the JVM you are using, copy either StockQuoteWTK-WEME6-<br />

PPRO11.lnk or StockQuoteWTK-CrEME4.lnk to the mobile computer<br />

\StockQuoteWTK folder.<br />

4 On the PC, browse to the lib subfolder of the <strong>Java</strong> Wireless Toolkit installation<br />

folder, and copy j2me-ws.jar and j2me-xmlrpc.jar to the mobile computer<br />

\StockQuoteWTK folder.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 53


5 In the ActiveSync window, click Explore and browse to the \StockQuoteWTK<br />

folder, where you should see the following files:<br />

6 On the <strong>Intermec</strong> mobile computer, use File Explorer to browse to the<br />

\StockQuoteWTK folder.<br />

7 To run the application with WEME, tap the shortcut StockQuoteWTK-WEME6-<br />

PPRO11.lnk (with the purple WebSphere icon next to it). The stock quote value<br />

is displayed in the J9 Console.<br />

To run the application with CrE-ME 4, tap the shortcut StockQuoteWTK-<br />

CrEME4.lnk. The result will be outputted to jscpout.txt located at the root folder of<br />

your mobile computer.<br />

Note: It may take several minutes <strong>for</strong> the web services call to return a response when<br />

running in CrE-ME 4.<br />

<strong>Developing</strong> a Web Services Client in NetBeans<br />

<strong>Developing</strong> a web services client application in NetBeans is easier than in Eclipse<br />

because you can rely on the <strong>Java</strong> ME plug-in to generate the web services stubs. If<br />

you have not already installed the <strong>Java</strong> ME plug-in, follow the instructions in<br />

‘‘Installing the <strong>Java</strong> ME Plug-in’’ to install it.<br />

54 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


The <strong>Java</strong> ME plugin <strong>for</strong> NetBeans 6.8 includes <strong>Java</strong> ME SDK 3.0. As noted in the<br />

beginning of ‘‘<strong>Developing</strong> a Web Services Client’’, the jsr172_1.0.jar file in <strong>Java</strong><br />

ME SDK does not work in CDC. There<strong>for</strong>e, we will use the plug-in only to generate<br />

the stubs. At runtime, we will use the JAR files in <strong>Java</strong> Wireless Toolkit 2.5.2. If you<br />

have not already installed <strong>Java</strong> Wireless Toolkit, download and install<br />

sun_java_wireless_toolkit-2.5.2_01-win.exe from the Sun <strong>Java</strong> Wireless Toolkit<br />

2.5.2_01 <strong>for</strong> CLDC Download web site.<br />

The following is a summary of the development process.<br />

1 Create a NetBeans <strong>Java</strong> project.<br />

2 Add web services JAR files from the <strong>Java</strong> Wireless Toolkit as external JARs.<br />

3 Generate the web services stubs.<br />

4 Create a <strong>Java</strong> class to call the web services API via the generated stub.<br />

5 Build the application.<br />

6 Deploy the application to an <strong>Intermec</strong> mobile computer.<br />

Creating the StockQuoteWTK <strong>Java</strong> Project<br />

1 In NetBeans, choose File > New Project. The New Project dialog box appears.<br />

2 In the Categories list, choose <strong>Java</strong> ME.<br />

3 In the Projects list, click CDC Application and then click Next.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 55


4 In the Name and Location screen:<br />

a In the Project Name field, enter StockQuoteWTK.<br />

b In the Project Location field, enter the path to the project location, or click<br />

Browse to browse to the project location. To accept the default location,<br />

continue with the next step.<br />

c Uncheck the Create Main Class checkbox.<br />

d Click Next.<br />

5 In the Select Plat<strong>for</strong>m screen, select pJSCP V4.12 B142.190307 from the <strong>Java</strong><br />

Plat<strong>for</strong>m drop-down list and then click Finish.<br />

56 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


Adding Web Services JAR Files<br />

Although we can use the <strong>Java</strong> ME plugin to generate the web services stubs, the<br />

CrEme emulator plat<strong>for</strong>m we use to compile this project does not have built-in<br />

support <strong>for</strong> the APIs in JSR 172. There<strong>for</strong>e, we need to add additional libraries that<br />

implement JSR 172. We will add two libraries, j2me-ws.jar and j2me-xmlrpc.jar from<br />

<strong>Java</strong> Wireless Toolkit 2.5.2 to the StockQuoteWTK project. These libraries allow the<br />

application to be successfully built in NetBeans, and they are included in the<br />

application JAR file as the build result.<br />

To add web services JAR files to the StockQuoteWTK project<br />

1 In the Projects window, right-click the StockQuoteWTK project and choose<br />

Properties in the popup menu.<br />

2 In the Category list, choose Build > Libraries and Resources.<br />

3 Click Add JAR/Zip.<br />

4 In the Add Jar or Zip file dialog box, browse to the lib subfolder of the<br />

installation folder of <strong>Java</strong> Wireless Toolkit 2.5.2.<br />

5 Choose both j2me-ws.jar and j2me-xmlrpc.jar and click Open.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 57


6 The Libraries and Resources list in the StockQuoteWTK project settings screen<br />

now includes the JAR files you added.<br />

Generating Web Services Stubs<br />

1 In the Projects window, right-click the StockQuoteWTK project and choose New<br />

> <strong>Java</strong> ME Web Service Client from the popup menu. The New <strong>Java</strong> ME Web<br />

Service Client dialog box appears.<br />

2 Make sure the Running Web Service button is selected (should be the default).<br />

3 In the WSDL URL field, enter http://www.webservicex.net/<br />

stockquote.asmx?WSDL and click Retrieve WSDL.<br />

4 After NetBeans successfully validates the WSDL, click Finish.<br />

58 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


Two <strong>Java</strong> classes, StockQuote.java and StockQuote_Stub.java, are generated with<br />

the package name “stockquote”.<br />

Creating a <strong>Java</strong> Class to Call the Web Services API<br />

1 In the Projects window, right-click the StockQuoteWTK project and choose New<br />

> <strong>Java</strong> Class from the popup menu. The New <strong>Java</strong> Class dialog box appears.<br />

2 In the Class Name field, enter StockQuoteMain.<br />

3 In the Package field, enter stockquote. This is the package name the stub<br />

classes were generated under. We will use the same package name so we don’t<br />

need to import this package.<br />

4 Click Finish.<br />

Copy the following code to the StockQuoteMain <strong>Java</strong> class and click<br />

package stockquote;<br />

to save it.<br />

public class StockQuoteMain {<br />

public static void main(String[] args)<br />

{<br />

String sSymbol = null; // Stock symbol<br />

if (args.length > 0)<br />

{<br />

sSymbol = args[0];<br />

}<br />

else<br />

{<br />

sSymbol = "IN"; // Default to <strong>Intermec</strong> symbol.<br />

}<br />

try<br />

{<br />

System.out.println("Making web services call...");<br />

StockQuote_Stub stub = new StockQuote_Stub();<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 59


}<br />

}<br />

String sQuoteXML = stub.getQuote(sSymbol);<br />

System.out.println("sQuote=" + sQuoteXML);<br />

// Get the value between and <br />

int indStart = sQuoteXML.indexOf("");<br />

int indEnd = sQuoteXML.indexOf("");<br />

if (indStart >= 0 && indEnd >= 0)<br />

{<br />

String sLatestValue =<br />

sQuoteXML.substring(indStart+6, indEnd);<br />

System.out.println("Quote=" + sLatestValue);<br />

}<br />

else<br />

{<br />

System.out.println("Missing tag in response");<br />

}<br />

}<br />

catch (Exception e)<br />

{<br />

e.printStackTrace();<br />

}<br />

Programming Notes<br />

The stock symbol is passed in as the first program argument. The default is “IN” if<br />

not specified. It calls the StockQuote_Stub.getQuote method to get the current<br />

quote. Note that this method returns an XML string. You can use the kXML library<br />

to parse the XML. The code uses methods in String to retrieve the value between the<br />

and tags.<br />

Building the StockQuoteWTK Project<br />

In the Projects window, right click on the StockQuoteWTK project and select Build<br />

in the popup menu. The build process begins and you see the build results in the<br />

Output window. If the build is successful, you can find StockQuoteWTK.jar in the<br />

dist subfolder of the StockQuoteWTK project folder.<br />

Deploying StockQuoteWTK onto Mobile Computer<br />

This section describes how to deploy the StockQuoteWTK web services client<br />

application to the mobile computer, following the guidelines described in<br />

“Deploying <strong>Applications</strong>.”<br />

Creating an Application Shortcut<br />

You may create a WEME or CrE-ME shortcut like the following:<br />

StockQuoteWTK-WEME6-PPRO11.lnk <strong>for</strong> WEME 6.2 Personal Profile 1.1<br />

255#"\J9\PPRO11\bin\j9.exe" "-jcl:ppro11" "-classpath"<br />

"\StockQuoteWTK\StockQuoteWTK.jar" stockquote.StockQuoteMain<br />

StockQuoteWTK-CrEME4.lnk <strong>for</strong> CrE-ME 4 Personal Profile 1.0<br />

255#"\windows\CrEme\bin\CrEme.exe" -Of -classpath<br />

'\StockQuoteWTK\StockQuoteWTK.jar' stockquote.StockQuoteMain<br />

60 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


Copying Files to the Mobile Computer<br />

1 Create a folder called StockQuoteWTK under the root directory of the mobile<br />

computer.<br />

2 Copy StockQuoteWTK.jar in the dist subfolder of the StockQuoteWTK project<br />

folder to the mobile computer \StockQuoteWTK folder.<br />

3 Depending on the JVM you use, copy either StockQuoteWTK-WEME6-<br />

PPRO11.lnk or StockQuoteWTK-CrEME4.lnk to the mobile computer<br />

\StockQuoteWTK folder.<br />

4 On the <strong>Intermec</strong> mobile computer, use File Explorer to browse to the<br />

\StockQuoteWTK folder.<br />

5 To run the application with WEME, tap the shortcut StockQuoteWTK-WEME6-<br />

PPRO11.lnk (with the purple WebSphere icon next to it) to run the application.<br />

The stock quote value is displayed in the J9 Console.<br />

To run the application with CrE-ME 4, tap on the shortcut StockQuoteWTK-<br />

CrEME4.lnk. The result is sent to jscpout.txt located at the root folder of your<br />

mobile computer.<br />

Note: It may take several minutes <strong>for</strong> the web services call to return a response when<br />

running in CrE-ME 4.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 61


Glossary<br />

AWT (Abstract Window Toolkit)<br />

AWT provides a basic set of graphical user interface (GUI) components that were<br />

implemented using native-plat<strong>for</strong>m versions of the components.<br />

CDC (Connected Device Configuration)<br />

CDC is a specification <strong>for</strong> a <strong>Java</strong> ME configuration. It targets network-connected<br />

devices that have more memory and processing power such as high-end personal<br />

digital assistants (PDAs).<br />

CLDC (Connected Limited Device Configuration)<br />

CLDC is a specification <strong>for</strong> a <strong>Java</strong> ME configuration. It targets resource-constrained<br />

devices like mobile phones and entry level personal digital assistants (PDAs).<br />

CrE-ME or CrEme<br />

CrE-ME or CrEme (by NSIcom) is a <strong>Java</strong> runtime environment <strong>for</strong> mobile<br />

computers. CrE-ME version 4 implements <strong>Java</strong> ME CDC Personal Profile 1.0.<br />

IDE (Integrated Development Environment)<br />

An IDE brings all tools needed <strong>for</strong> programming such as source code editor,<br />

compiler, debugger, etc. in one environment to facilitate software development.<br />

IDL (<strong>Intermec</strong> Developer Library)<br />

IDL provides developers with tools and resources to develop applications <strong>for</strong><br />

<strong>Intermec</strong> mobile computers and RFID readers.<br />

IDL Resource Kits<br />

IDL Resource Kits provide C/C++, .NET, <strong>Java</strong> and Web APIs <strong>for</strong> building<br />

applications that take full advantage of features integrated into <strong>Intermec</strong> mobile<br />

computers, RFID readers and peripherals.<br />

JDK (<strong>Java</strong> SE Development Kit)<br />

JDK is the software development kit from Sun Microsystems to develop <strong>Java</strong><br />

applications and applets <strong>for</strong> <strong>Java</strong> Plat<strong>for</strong>m Standard Edition (<strong>Java</strong> SE). The JDK<br />

version numbering scheme changes in version 1.5. Version 1.5 becomes JDK 5, and<br />

1.6 becomes JDK 6.<br />

<strong>Java</strong> EE (<strong>Java</strong> Plat<strong>for</strong>m, Enterprise Edition)<br />

<strong>Java</strong> EE is a <strong>Java</strong> plat<strong>for</strong>m <strong>for</strong> enterprise <strong>Java</strong> computing.<br />

<strong>Java</strong> ME (<strong>Java</strong> Plat<strong>for</strong>m, Micro Edition)<br />

<strong>Java</strong> ME is a <strong>Java</strong> plat<strong>for</strong>m designed <strong>for</strong> mobile devices and embedded systems.<br />

<strong>Java</strong> SE (<strong>Java</strong> Plat<strong>for</strong>m, Standard Edition)<br />

<strong>Java</strong> SE is a widely used <strong>Java</strong> plat<strong>for</strong>m <strong>for</strong> developing and deploying <strong>Java</strong><br />

applications on desktops and servers.<br />

62 <strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong>


JCE (<strong>Java</strong> Cryptography Extension)<br />

JCE provides a framework and implementation <strong>for</strong> encryption, key generation, key<br />

agreement, and message authentication code (MAC) generation services. The CDC<br />

Foundation Profile 1.1 specification, JSR 219, includes the JCE optional package.<br />

JDBC (<strong>Java</strong> Database Connectivity)<br />

JDBC is an API that enables <strong>Java</strong> applications to access SQL-based databases or<br />

tabular data sources.<br />

JNI (<strong>Java</strong> Native Interface)<br />

JNI is a standard programming interface that allows <strong>Java</strong> methods to invoke native<br />

methods implemented in C or vice versa.<br />

JPDA (<strong>Java</strong> Plat<strong>for</strong>m Debugger Architecture)<br />

JPDA provides the infrastructure to build end-user debugger applications <strong>for</strong> <strong>Java</strong><br />

plat<strong>for</strong>ms.<br />

JSR (<strong>Java</strong> Specification Request)<br />

JSR is a <strong>for</strong>mal document that describes proposed specifications and technologies<br />

to be added to the <strong>Java</strong> plat<strong>for</strong>m.<br />

JSSE (<strong>Java</strong> Secure Socket Extension)<br />

JSSE is a set of packages that enables secure internet communications. The CDC<br />

Foundation Profile 1.1 specification, JSR 219, includes the JSSE optional package.<br />

MIDP (Mobile In<strong>for</strong>mation Device Profile)<br />

MIDP is a specification that defines a profile to extend the <strong>Java</strong> ME CLDC.<br />

Personal Profile<br />

Personal Profile is a specification that defines a profile to extend the <strong>Java</strong> ME CDC.<br />

It has full AWT 1.1 support and includes all the APIs in the other CDC profiles,<br />

Foundation Profile and Personal Basis Profile.<br />

RMI (<strong>Java</strong> Remote Method Invocation)<br />

RMI is an API that allows a <strong>Java</strong> object to invoke methods on an object running in<br />

another JVM. JSR 66 defines the RMI optional package <strong>for</strong> <strong>Java</strong> ME.<br />

SOAP (Simple Object Access Protocol)<br />

SOAP is an XML-based messaging protocol <strong>for</strong> exchanging structured in<strong>for</strong>mation<br />

in a distributed environment. SOAP is used to invoke web services.<br />

WEME (WebSphere Everyplace Micro Environment)<br />

WEME (by IBM) is a <strong>Java</strong> runtime environment <strong>for</strong> mobile computers that<br />

implements <strong>Java</strong> Plat<strong>for</strong>m, Micro Edition (<strong>Java</strong> ME). The current WEME version<br />

<strong>Intermec</strong> resells, WEME 6.2, implements <strong>Java</strong> ME CDC/Personal Profile 1.1.<br />

WSDL (Web Services Definition Language)<br />

WSDL is an XML-based language to describe how to access a web service and what<br />

operations it per<strong>for</strong>ms.<br />

<strong>Developing</strong> <strong>Java</strong> <strong>Applications</strong> <strong>for</strong> <strong>Intermec</strong> <strong>Computers</strong> 63


Worldwide Headquarters<br />

6001 36th Avenue West<br />

Everett, Washington 98203<br />

U.S.A.<br />

tel 425.348.2600<br />

fax 425.355.9551<br />

www.intermec.com<br />

© 2010 <strong>Intermec</strong> Technologies<br />

Corporation. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!