Oracle® Java Micro Edition Software Development Kit Developer's Guide Release 3.0.5 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. Using this simple yet powerful tool you can create, edit, compile, package, and sign an application. After testing your application in the 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) and Connected Device Configuration (CDC) platforms.
As of version 3.0.5, the Java ME SDK is plugin to the NetBeans IDE. In NetBeans the Mobility Pack is a prerequisite to installing the Java ME SDK.
The Java ME SDK plugin uses NetBeans technology, as described in the 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.
Select Help > Help Contents to open the JavaHelp Online Help viewer. You can also type F1. 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.1, "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 platform property that is used if you run from the toolbar (the green arrow), the Run menu, or 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. Choose a different device and click OK.
The emulator is an independent process, and once 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.1, "Running a Project".
The SDK provides two unique instances for most devices. For example, DefaultCldcPhone1 and DefaultCldcPhone2 are the same except for the phone number. This means you can perform tests that require two devices (messaging, for example) without customization. If you want to run more than two emulators you can easily make a copy that preserves the settings you require. See Section 6.9, "Adding a Device Instance".
If you used the Sun Java Wireless Toolkit for CLDC or the CDC Toolkit in the past, the advice in Section 1.1, "Quick Start" still applies because although the user interface is quite different, the project concept is similar. These 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 matches project requirements and device capabilities for you, so mismatches do not occur.
As mentioned in the Section 1.1, "Quick Start", clicking the green arrow runs the main project. You can right-click any project and select run.
In the 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.
See Section 4.2.4, "Platform Selection (CDC)" and Section 4.2.6, "CDC Toolkit Project Location".
Toolkit settings are Application Descriptors in the SDK. Right-click on a project and select Properties. Choose the Application Descriptor category.
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.
Select Window > Output in the NetBeans IDE to see the output of the WMA Console or the Payment Console.
Profiling 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's important to realize that the emulator is a remote process, and once 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, see Section 3.1, "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 property that must be set explicitly for the device instance.
The SDK provides two unique instances for most devices. For example, DefaultCldcPhone1 and DefaultCldcPhone2 are the same except for the phone number. This means you can perform tests that require two devices (messaging, for example) without customization. If you want to run more than two emulators you can easily make a copy that preserves the settings you require. See Section 6.9, "Adding a Device Instance".
The emulator has additional display functionality. See Section 6.7, "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 independently so the plugin can be renewed as necessary.
To detect updates, select Tools > Java ME > Java ME SDK Update Center and choose the Available tab. Any available updates will be listed. Choose an update and click Install to update the plugin.