NetBeans Mobility Pack for CDC 5.5 Quick Start Guide
Introduction
A CDC application is an application that is meant to run on a hand-held or
wireless device that has at least 2MB of memory. This configuration supports
a more feature-rich JVM than cellular phones, which typically have 128 to 512KB
of memory and use the Connected Limited Device Configuration (CLDC).
This document takes you through the basics of using NetBeans Mobility Pack for CDC 5.5 to create a Java Platform, Micro Edition (Java ME platform),
Connected Device Configuration (CDC) application. The guide takes you through
some of the basic steps of creating a new CDC Project. We will show you three
ways to create a Java ME CDC project that displays a simple form in a device
emulator, one way for each profile. This document is designed to get you going
as quickly as possible.
The sections in this guide are:
Software Requirements
The software and hardware requirements for the CDC Mobility Pack are listed
in the NetBeans Mobility Pack for CDC 5.5 Release Notes.
Adding Emulator Platforms
The NetBeans Mobility Pack supports the following emulator platforms:
- Sun Java Toolkit for CDC 1.0
- Ricoh Embedded Software Architecture Emulator 1.14c
- UIQ SDK 3
- Sony Ericsson M600 and P990 devices
- Nokia Series 80 Platform SDK for Symbian OS, for Java, Personal Profile
- SavaJe Operating System
Instructions for adding emulator platforms are listed in the NetBeans Mobility Pack for CDC 5.5 Installation Guide.
Creating a CDC Application
In this section we will create a CDC application project for each available
profile and, for the Personal and AGUI platforms, create a GUI for the application
using the IDE's GUI Builder.
The Profiles described are:
Creating a New CDC Application - Foundation Profile
Here we will create a CDC Application, or Xlet,
for the Foundation Profile using the Ricoh Embedded Software Architecture
Emulator 1.14c.
- Choose File > New Project (Ctrl-Shift-N) from the main window.
- Under Categories, select CDC. Under Projects, select the CDC Application
template. Click Next.
- In the Select Platform Page, choose Ricoh 1.14c.
- In the Name and Location panel, name the project MyRicohApplication
and specify a location for the project on your computer. Leave the Create
Main Class checkbox selected.
- Leave the UID as generated.
- Specify the Application Name, which is the human-readable name of the
application. In our example, we will enter My Ricoh CDC App for
this field.
- Click Finish. The IDE creates the new application and opens the main class
in the Source Editor. The project structure is shown in the following figure.
Note that the generated code is based on the profile. In this case, the
main class is derived from
jp.co.ricoh.dsdk.xlet.Xlet. This
profile does not support the Netbeans GUI Designer.
- To run the project, choose Run > Run Main Project. The emulator displays
the text, "TODO implement makeUIControls."
- You can also debug the project, and create and debug tests using the JUnit
framework.
Creating a New CDC Application - Personal Profile
Here we will create an applet for the Personal Profile using the Nokia
Series 80 Platform SDK for Symbian OS, for Java, Personal Profile. The Sony
Ericsson platform also supports the Personal Profile.
- Choose File > New Project (Ctrl-Shift-N) from the main window.
- Select the CDC Application template from the CDC Platform category. Click
Next.
- In the Select Platform Page, choose the Nokia S80 Platform. Click Next.
- Name the project S80CdcApplication and specify a location for
the project on your computer. Leave the Create Main Class check box selected.
- Specify the Application Name, which is the human-readable name of the
application. In our example, we will enter My First CDC App for
this field.
- Click Finish. The IDE creates the new application and opens the main class
form in the GUI Builder, as shown in the following figure. Note that the
generated code is based on the profile. In this case, the main class is
derived from
java.awt.Frame.
Creating the Application Interface Using the Project
Matisse GUI Builder
You can use the Project Matisse GUI Builder in the same way you use it
for regular J2SE development. In the GUI Builder, right-click the Main.java
form and choose Set Layout > Free Layout. Then drag and drop components
from the Palette window into the Design Area of the GUI Builder. Make
sure you only use AWT components in your form. Because all the Nokia
Series 80 devices support the Personal Profile, only AWT widgets are available.
For more information on using the IDE's GUI Builder, see the Java
GUIs and Project Matisse Learning Trail.
When you are done, right-click the project in the Projects window and
choose Run Project. Your application should be displayed in the Applications
menu in the device emulator. You can now run the device in the emulator.
You can also debug the project, and create and debug tests using the JUnit
framework
Building Distribution Files
You're now ready to finish your application. Right-click the project and choose
Build Target Bundle. The IDE creates the SIS file in the PROJECT_HOME/target
folder. You can see this file in the Files window. If you specified additional
parameters, like certificate, private key, and password, the IDE also signs
the SIS file for you.
To build a Nokia project, use the Build SIS command as well. While doing
an SIS build for Nokia is not supported yet, you can deploy the application
using the JAR file created under PROJECT_HOME/dist.
Creating a New CDC Application - AGUI Profile
Here we will create a CDC Application, or Xlet, for the AGUI Profile
using the Sun Java Toolkit for CDC 1.0. The AGUI Profile is also supported by
the SavaJe OS platform.
Note: For more information about developing for the SavaJe platform, see "Developing
for the SavaJe Platform."
- Choose File > New Project (Ctrl-Shift-N) from the main window.
- From Categories, select CDC. From Projects, select CDC Application. Click
Next.
- In the Select Platform page, use the drop-down menu to choose
DefaultColorPhone
as the Device. Leave the Platform and Profile settings as they are.
- In the New CDC Application panel:
- Name the project
newcdc.
- You do want to create a Main class, even though it's really an Xlet class
and not a Java SE class, with
main().
- Change the package/classname to
Mainxlet.
- The Application Name is the name that will show up as the bundle title
(on the My Application Menu).
- Click Finish. The IDE creates the new application and opens the main class
form in the GUI Builder, as shown in the following figure.
Creating the Application Interface Using the Project
Matisse GUI Builder
You can use the Project Matisse GUI Builder in the same way you use it
for regular J2SE development. In the GUI Builder, right-click the Main.java
form and choose Set Layout > Free Layout. Then drag and drop components
from the Palette window into the Design Area of the GUI Builder. Make
sure you only use Swing components in your form. Because the AGUI
platform supports Swing, only Swing widgets are available.
For more information on using the IDE's GUI Builder, see the Java
GUIs and Project Matisse Learning Trail.
When you are done, right-click the project in the Projects window and
choose Run Project. Your application should be displayed in the device
emulator.
You can also debug the project, and create and debug tests using the JUnit
framework.
W
Next Steps
In addition to the built-in help system, the NetBeans Mobility Pack for
CDC is documented through a series of tutorials and articles. For information
about the Java ME, CDC development features supported by the Mobility Pack
for CDC, see the following documents: