The Java™ 2 Platform, Micro Edition (J2ME™), Wireless Toolkit User’s Guide describes how to work with the Wireless Toolkit and its components.
The J2ME Wireless Toolkit version 2.1 supports development of applications compliant with the Java Technology for the Wireless Industry, Java Specification Request (JSR-185). The J2ME Wireless Toolkit version 2.1 also includes support for J2ME Web Services (JSR-172).
Java Technology for the Wireless Industry clarifies how the various technologies associated with the J2ME Connected Limited Device Configuration (CLDC) and Mobile Information Device Profile (MIDP) work together to form a complete Java™ Runtime Environment (JRE). The environment enables the deployment of end-to-end solutions on mobile phones and other mobile information devices.
The Java Technology for the Wireless Industry Roadmap 1 provides an outline of common functionality that software developers can use to develop applications for JSR-185 compliant devices. The specification requires certain component technologies, namely, CLDC 1.0, MIDP 2.0 and Wireless Messaging API (WMA) 1.1 (JSR-120). Version 1.0 of the Java Technology for the Wireless Industry conditionally requires other component technologies, such as CLDC 1.1 and Mobile Media API (MMAPI) 1.1, depending on the functionality of your application. For more information about Java Technology for the Wireless Industry, see
http://java.sun.com/products/jtwi.
The implementation of the Java Technology for the Wireless Industry is the Wireless Toolkit version 2.1, which supports CLDC 1.1, MIDP 2.0, WMA 1.1, and MMAPI 1.1. You can still use the Wireless Toolkit, version 2.1 to develop applications that use CLDC 1.0 or MIDP 1.0.
This document assumes that you are familiar with Java programming, MIDP 2.0 and the Connected Limited Device Configuration (CLDC). This document also assumes familiarity with the Mobile Media API (MMAPI) and the Wireless Messaging API (WMA) for those developing wireless messaging applications or applications that make use of multimedia. You can find more information about the topics described in this chapter at the following URLs:
The KToolbar, included with the J2ME Wireless Toolkit, is a minimal development environment with a Graphical User Interface (GUI) for compiling, packaging, and executing MIDP applications. The only other tools you need are a third-party editor for your Java source files and a debugger.
An IDE compatible with the J2ME Wireless Toolkit, such as the Sun™ Open Net Environment (Sun ONE) Studio IDE, provides even more convenience. For example, when you use the Wireless Toolkit within an IDE, you can edit, compile, package, and execute or debug MIDP applications, all within the same environment. For a list of IDEs that are compatible with the Wireless Toolkit, see the Java™ 2 Platform, Micro Edition, Wireless Toolkit web page at http://java.sun.com/products/j2mewtoolkit/.
When working with the J2ME Wireless Toolkit in standalone mode, you work mainly through the KToolbar. The features available to help you create, modify, and test your MIDlet suite are described briefly in the following sections.
When you compile MIDlets through the KToolbar (or an IDE compatible with the toolkit), your source files are compiled using the Java™ 2 Platform, Standard Edition (J2SE™) SDK compiler. Preverification of the compiled files is done with the Preverifier that prepares class and JAR files and class directories. Preverification takes place automatically for you immediately after compilation. You can debug applications within the environment using the Emulator, which simulates the execution of the application on various devices. For more information on how to compile, preverify, and debug files using KToolbar, see Chapter 3, “Operating with KToolbar.”
You can package your MIDlet suite from the KToolbar or with a compatible IDE. The KToolbar gives you the choice of creating a standard package or creating an obfuscated package that produces a smaller JAR file by reducing the size of the classes in the suite through the obfuscation process.
For more information on packaging and obfuscated packaging, see Chapter 2, “Developing and Running Applications.” For information on how to package applications using the KToolbar, see Chapter 3, “Operating with KToolbar.”
Running a MIDlet suite on the emulator can be done either locally (running directly from the classpath without packaging) to see the application perform immediately after a build or remotely through Over-The-Air (OTA) provisioning (emulation of the application provisioning and installation from the server to the device).
For a description on different ways to run your application, see Chapter 2, “Developing and Running Applications.” For information on testing your applications with OTA provisioning or remotely from a web server, see Chapter 8, “Testing Application Provisioning.”
You can create trusted applications that have permission to use protected APIs. You can request permission to access network protocol APIs through the Project Settings dialog box from the KToolbar. You can sign your MIDlet suite and assign a security domain that defines the suite’s authorization level with the Sign MIDlet Suite window.
For information on signing a MIDlet suite, see Chapter 6, “Using Security Features in the Wireless Toolkit.”
The Wireless Toolkit’s Profiler enables you to optimize the performance of your MIDlet suite by determining where bottlenecks might be occurring during runtime. You can improve the execution time of your MIDlet suite by examining the time spent in method calls, the number of times a method is called during runtime, and the amount of time a method runs compared to the overall runtime of the application.
You can also adjust the performance speed of your application in the Performance panel of the Project Settings dialog box. Setting the speed features does not demonstrate how your application would run on an actual device; however, by adjusting the speed emulation parameters, you can achieve a better representational performance of your application on a device.
For information on how to use the Profiler and how to manage device speed, see Chapter 4, “Performance Tuning and Monitoring Applications.”
The Wireless Toolkit provides you with tools to examine and analyze memory usage by your application and network transmissions between your device and the network. You can get an overall view of memory usage during runtime of your application and get a breakdown of memory usage per object to see where in the application you can optimize memory usage.
With the Network Monitor, you can examine network transmissions for several types of network protocols.
For information on how to use the Memory and Network Monitors, see Chapter 4, “Performance Tuning and Monitoring Applications.”
The J2ME Wireless Toolkit comes with a selection of emulated devices for you to run and test your applications on. Representations of mobile devices are available from the Device list on the KToolbar. Java Technology for the Wireless Industry defines the technologies to be included in compliant phones. These technologies include CLDC, MIDP, MMAPI, and WMA.
You can set the functionality for an emulated device through the Preferences window. You can also start various emulator utilities such as the Profiler, the Network Monitor, the Memory Monitor, and the Certificate Manager from the Utilities window. For more information on the Emulator, see Chapter 5, “Working With the Emulator.”
For information on examining applications that you develop that use network protocols or wireless messaging, see Chapter 4, “Performance Tuning and Monitoring Applications.”
To test applications that use wireless messaging, the Wireless Toolkit provides the WMA console, which you can use to send and receive binary and text SMS messages. You can also use the console to broadcast CBS messages to devices. For more information about the WMA console, see Chapter 7, “Wireless Messaging with the Wireless Toolkit.”
You can run the Wireless Toolkit and display your application in your desired language by setting the locale properties of the Wireless Toolkit and the Emulator. You can also change the character encoding setting for the device MIDP environment and for the Java compiler. For more information on internationalization, see Appendix C, “Internationalization.”
You can generate a stub connector to access J2ME Web Services from the KToolbar. The Emulator is compliant with the J2ME Web Services specification. The Stub Generator is created using a Web Service Descriptor Language file (WDSL), provided by the user. You can launch the stub generator from the KToolbar using the File menu’s Utilities option, from the Project menu, or you can run it from the command line. See Appendix D, “Command Line Utilities” for more information
Many of the basic development operations available from the KToolbar can also be performed at the command line such as compiling and preverifying, creating manifest files, JAR and JAD files, running emulators, tracing and debugging, invoking the Stub Generator, and using the Application Management System. You can also sign MIDlet suites and manage certificates from the command line. See Appendix D, “Command Line Utilities” for more information.
The Wireless Toolkit comes with the several demo applications, which can all be run in the Emulator. You can select a demo application from the Open Project list from the KToolbar. For information on the demo applications, see the Application Demos page in the {j2mewtk.dir}\docs
directory.
User's Guide Java™ 2 Platform, Micro Edition, Wireless Toolkit, Version 2.1 |
Copyright © 2003 Sun Microsystems, Inc. All rights reserved.