FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Mobility CDC Development Quick Start Guide

Introduction

CDC applications are designed to run on mobile and embedded devices with at least 2MB of memory. This configuration supports a more feature-rich JVM than MIDP-based mobile phones, which typically have much less memory and use the Connected Limited Device Configuration (CLDC).

This document shows you how to use NetBeans IDE to create a Java Platform, Micro Edition (Java ME platform), Connected Device Configuration (CDC) application. We show you how to create a Java ME CDC project that displays a simple form in a device emulator for the three available profiles. This document is designed to get you creating applications as quickly as possible.

Contents

Content on this page applies to NetBeans IDE 6.0 and 6.1

Requirements

You must have the NetBeans IDE 6.0 or 6.1 Mobility or Full edition (download) installed before you can start Java ME CDC development.

  • Sun Java Toolkit for CDC or other CDC emulator platform must also installed.

Adding Emulator Platforms

Supported CDC Profiles

In order to develop applications for CDC devices, you must install and register a CDC emulator platform in the IDE. Note that CDC emulator platforms support different development profiles. The three main development profiles and the emulators that support them are:

  • AGUI (Sun Java Toolkit for CDC) supports advanced graphical layouts. (more info)
  • Personal Profile (Nokia, Sony Ericsson) is the most popular profile for smartphone development. (more info)
  • Foundation Profile (Ricoh) is used in consumer and embedded devices with limited resources and non-standard GUIs. (more info)

Available Platforms

Instructions for adding the following supported emulator platforms are listed in the NetBeans CDC Platform Emulator Setup Guide.

  • Sun Java Toolkit for CDC 1.0
  • Ricoh Embedded Software Architecture Emulator 1.14c
  • Sony Ericsson CDC Platform UIQ SDK 3
  • Sony Ericsson M600 and P990 devices
  • Nokia Series 80 Platform SDK for Symbian OS, Java and Personal Profile
  • NSIcom CrEme VM for Windows CE

In the following sections we create a CDC project using each available profile and also use the IDE's GUI builder in the Personal and AGUI profile applications to enhance the User Inerface.

Creating a New CDC Application - AGUI Profile

Here we create a CDC Application, or Xlet, for the AGUI Profile using the Sun Java Toolkit for CDC 1.0.

  1. Choose File > New Project (Ctrl+Shift+N) from the main window.
  2. From Categories, select Mobility. From Projects, select CDC Application. Click Next.
  3. In the Name and Location page:
  • Name the project newcdc.
  • Change the Main Class name to newcdc.Mainxlet.
  • Leave the Set as Main Project and Create Main Class check boxes checked.
  1. In the Select Platform page, use the drop-down menus to choose Sun Java Toolkit for Connected Device Configuration for the Java Platform and DefaultColorPhone as the Device. Leave the Profile settings as it is.
  2. New Project Wizard Select Platform Page. The page shows the following drop-down menu choices: Platform: Sun Java Toolkit 1.0 for Connected Device Configuration; Device: DefaultColorPhone; Profile: AGUI-1.0.
  3. Click Finish. The IDE creates the new application and opens the main class form in the GUI Builder.

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 about creating GUIs for CDC applications, see the GUI Design with NetBeans Mobility Pack for CDC.

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.

Shows the Default Color Phone Device Emulator running over the NetBeans IDE.

You can also debug the project, and create and debug tests using the JUnit framework.

Creating a New CDC Application - Personal Profile

Here we 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.

  1. Choose File > New Project (Ctrl+Shift+N). Under Categories, select Mobility. Under Projects, select the CDC Application template. Click Next.
  2. Name the project S80CdcApplication and specify a location for the project on your computer. Leave the Create Main Class check box selected. Click Next.
  3. In the Select Platform Page, choose the Nokia S80 Platform.
  4. Click Finish. The IDE creates the new application and opens the main class form in the GUI Builder, as shown in the following figure. Click on Source to see the source code for the applet. 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 Design. 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.

Creating a New CDC Application - Foundation Profile

Here we create a CDC Application, or Xlet, for the Foundation Profile using the Ricoh Embedded Software Architecture Emulator 1.14c.

  1. Choose File > New Project (Ctrl+Shift+N). Under Categories, select Mobility. Under Projects, select the CDC Application template. Click Next.
  2. 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 check box selected. Click Next.
  3. In the Select Platform Page, choose Ricoh 1.14c.
  4. 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.
  5. To run the project, choose Run > Run Main Project. The emulator displays the text, "TODO implement makeUIControls."
  6. Screenshot of the Ricoh emulator.
  7. You can also debug the project, and create and debug tests using the JUnit framework.

See Also

More information about developing mobile applications using the IDE can be found at the following locations:

Bookmark this page

del.icio.us furl simpy slashdot technorati digg
Companion
Projects:
MySQL Database Server   Open JDK: an Open SourceJDK   GlassFish Community: an Open Source Application Server    Mobile & Embedded Community    Open Solaris   java.net - The Source for Java Technology Collaboration   Open ESB - The Open Enterprise Service Bus Powered by