Oracle® Java Micro Edition Software Development Kit Developer's Guide Release 3.3 for Windows E24265-05 |
|
Previous |
Next |
Beta Draft: 2013-06-07
The Oracle Java ME SDK provides supporting tools and sample implementations for the latest in Java ME technology. It provides support for recent versions of the Connected Limited Device Configuration (CLDC), Information Module Profile - Next Generation (IMP-NG), and Connected Device Configuration (CDC) platforms.
Note: As of version 3.3, the Java ME SDK is a plugin to the NetBeans IDE. In NetBeans, the Mobility Pack is a prerequisite for installing the Java ME SDK |
The Oracle Java ME SDK is also a plugin to the Eclipse IDE. For more information on using Java ME SDK with the Eclipse IDE, see Oracle Java Micro Edition Software Development Kit Developer's Guide for Eclipse.
The Oracle Java ME SDK plugin uses NetBeans technology, as described in the NetBeans online help. These tips offer some hints for getting started as quickly as possible.
Access the documentation. The online help is the primary documentation for the SDK. Many windows and dialogs feature a help button that opens context-sensitive help in the help viewer. You can also type F1.
Select Help > Help Contents to open the JavaHelp Online Help viewer. Remember to use the search capability and the index to help you find topics.
Run sample projects. Running sample projects is a good way to become familiar with the SDK.
See "Running a Project" for a general overview of how to run a project.
See the Projects window and the Files window for a visual overview of the logical and physical layout of a project. When viewing items in the tree, use the context menu (right-click) to see the available actions. See "Working With Projects."
A project has a default device that is used when you run it from the toolbar (the green arrow), Run > Run Project, or Run on the project's context menu. To see a project's default device, right-click the project and select Properties. Select the Platform category to see the default device displayed in the Device field. To reset the Device make another choice from the dropdown menu.
To run an application on different devices without changing the default device, right-click on the project and select Run With from the context menu. Select a different device and click OK.
The emulator is an independent process, and when it has started it is a separate process from the build process running in NetBeans. Stopping the build process or closing a project does not always affect the application running in the emulator. You must be sure to terminate the application (the emulator can remain open). See "Running a Project."
The SDK provides two unique instances for most devices. For example, IMPNGDevice1 and IMPNGDevice2 are the same except for the device number and the phone number, so you can perform tests that require two devices (messaging, for example) without customization. If you want to create your own device, see "Using the Custom Device Editor."
If you previously used the Sun Java Wireless Toolkit for CLDC or the CDC Toolkit, the advice in "Quick Start" still applies. Although the user interface is quite different, the project concept is similar. The following tips apply legacy terms and ideas to the SDK.
Runtime focus is less on the project and more on device capabilities and the emulation process.
In legacy toolkits you had to be careful to match the platforms, the APIs, and the capability of the output device. The SDK handles this problem differently, but as described in "Java ME Platforms," you should be sure that the emulator platform is correct and a device profile is selected.
Clicking the green arrow runs the main project. If no project is set as the main project, clicking the green arrow runs the current project. To set a main project, click the Run menu, select Set Main Project, and select a project from the dropdown menu. Alternatively, you can right-click any open project and select run.
In the device selector (Tools > Java ME > Device Selector) you can test many devices without changing the project properties. Right-click any device and choose Run Project, Run via OTA, or Run JAR or JAD... and select a project, or in the case of running a JAR or JAD, select the application's JAR or JAD file. Only projects that are compatible with the device are shown in the context menu.
Import applications from legacy toolkits to SDK projects. The installation of the legacy toolkit must exist on the host machine. See "Import a Legacy MIDP Project," "Create a Platform for Legacy CDC Projects," and "Import a Legacy CDC Project."
Legacy toolkit settings are Application Descriptors in the SDK. Right-click a project and select Properties. Choose the Application Descriptor category.
Legacy toolkit utilities are generally accessible from Tools > Java ME submenu in the NetBeans IDE. For example, the WMA console, the Java ME SDK Update Center and more can be started from the Tools > Java ME submenu.
For example, select Tools > Java ME > WMA Console in the NetBeans IDE to see the WMA Console output.
CPU Profiler, Network Monitor, and Memory Monitor utilities can be accessed from the Profile menu or by right-clicking a project and selecting Profile. See Chapter 9, "Profiling Applications," Chapter 10, "Network Monitoring," and Chapter 11, "Monitoring Memory" for information on running these utilities.
The emulator is familiar, but there are some fundamental differences.
It is important to realize that the emulator is a remote process, and when it starts it is independent of the build process running in NetBeans. Stopping the build process or closing a project does not always affect the application running in the emulator. You must be sure to terminate the application from the emulator. For more on this topic, see "Running a Project" and "Working With Projects."
In the Wireless Toolkit, you could simultaneously run multiple versions of a device because the toolkit would increment the phone number automatically each time you launched a project. Because the emulator is now a remote process, the phone number is a unique property that must be set explicitly for the device instance.
The emulator has additional display functionality. See "Emulator Features."
The Java ME SDK Update Center supports automatic updating of the entire Java ME SDK plugin, and individual modules within the Java ME SDK. To access the update center, select Tools > Java ME > Java ME SDK Update Center. The update center uses the same technology as the NetBeans Plugins Manager. The update manager works separately from NetBeans so that the Java ME SDK plugin can be updated independently.
Java ME SDK plugins are displayed in their own category named Java ME SDK Tools. The plugins are organized into the following bundles:
Java ME SDK Tools
Java ME SDK Demos
To detect new updates, select Tools > Java ME > Java ME SDK Update Center and select the Available tab. Brand new updates not already installed are listed under the Available tab. Select an update and click Install to update the plugin. The plugins then appear as activated on the Installed tab.
If Oracle Java ME SDK plugins are already installed on your machine and a newer version is available, it is listed under the Updates tab. Select an update and click Install to update the plugin. The plugins then appear as activated on the Installed tab.
Note: If you cannot connect to the Update Center, you may need to set your Proxy settings. For more information, see "Configuring the Web Browser and Proxy Settings." |
Demos are delivered separately for two reasons:
Some demos use network access for test purposes, however, the sample code does not include protection against malicious intrusion. Before using the demos, see the "Installation and Runtime Security Guidelines" in Chapter A.
Sample code has a different copyright that allows you to redistribute provided the Oracle copyright is kept.