Oracle® Java Micro Edition Software Development Kit Developer's Guide Release 3.2 for Windows E24265-04 |
|
Previous |
Next |
The Oracle® Java Micro Edition (Java ME) Software Development Kit (SDK) is a natural starting point for learning and using Java ME technology. The focus of the SDK is to provide emulation and deployment assistance during the development process. This chapter introduces the SDK and provides a quick introduction to using the SDK.
Using this simple yet powerful tool you can create, edit, compile, package, and sign an application. After testing your application in the Oracle Java ME SDK emulation environment, you can move to deploying and debugging on a real device.
This SDK provides supporting tools and sample implementations for the latest in Java ME technology. The SDK 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.
As of version 3.2, 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 Java ME SDK is also a plugin to the Eclipse IDE. This documentation does not discuss the Eclipse IDE. A separate online help system supports the Oracle Java ME SDK 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 Section 3.2, "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 Section 4.3, "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. Choose the Platform category and you 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. Choose 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 Section 3.2, "Running a Project".
The SDK provides two unique instances for most devices. For example, JavaMEPhone1 and JavaMEPhone2 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 Section 6.11, "Using the Custom Device Skin Creator".
If you previously used the Sun Java Wireless Toolkit for CLDC or the CDC Toolkit, the advice in Section 1.1, "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 Section 2.2.1, "Java ME Platforms", you should be sure that the emulator platform is correct and a device profile is selected.
As mentioned in the Section 1.1, "Quick Start", clicking the green arrow runs the main project (to set the main project select Run > 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. 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 Section 4.2.4, "Import a Legacy MIDP Project", Section 2.2.2, "Create a Platform for Legacy CDC Projects", and Section 4.2.5, "Import a Legacy CDC Project".
Legacy toolkit settings are Application Descriptors in the SDK. Right-click on 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.
Profiling output and Network monitoring utilities are accessed from the Profile > Java ME submenu in the NetBeans IDE.
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 Section 3.2, "Running a Project" and Section 4.3, "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 SDK provides two unique instances for most devices. For example, JavaMEPhone1 and JavaMEPhone2 are the same except for the phone number, so you can perform tests that require two devices (messaging, for example) without customization.
The emulator has additional display functionality. See Section 6.9, "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 is delivered as three NetBeans plugins in their own category named Java ME SDK Tools. The plugins are:
Java ME SDK Tools
LWUIT Resource Editor
Java ME SDK Demos
To detect updates, select Tools > Java ME > Java ME SDK Update Center and choose the Available tab. Any available updates are listed. Choose an update and click Install to update the plugin. The plugins then appear as activated on the Installed tab.
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, please see the "Installation and Runtime Security Guidelines" in the Oracle Java Micro Edition Software Development Kit Release Notes.
Sample code has a different copyright that allows you to redistribute provided the Oracle copyright is kept.