NetBeans Java ME CDC Development Quick Start Guide


Connected Device Configuration (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 tutorial shows you how to use NetBeans IDE to create a Java Platform, Micro Edition (Java ME platform) 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 CDC profiles. This document is designed to get you creating applications as quickly as possible.

Note: If you are using NetBeans IDE 7.3, refer to the NetBeans 7.3 Java ME CDC Development Quick Start Guide.


Content on this page applies to NetBeans IDE 7.4


To complete this tutorial, you need the following software and resources:

Software or Resource Version Required
NetBeans IDE with Java ME 7.4
Java Development Kit (JDK) 7
Oracle Java ME SDK 3.2 or more recent

Supported CDC Emulator Platform

NetBeans IDE supports Oracle Java ME SDK for the Windows platform. Oracle Java ME SDK allows you to develop CDC applications. Note that different CDC emulator platforms support different development profiles. The main development profile and emulator that supports them is Personal Basis Profile (Java ME SDK) (more info)


Installing Oracle Java ME SDK (on Windows)

  1. Go to the Java ME SDK Download page.
  2. Click the Accept License Agreement option.
  3. Download an Oracle Java ME SDK installer file and save it to any location on your computer.
  4. Double-click the installer file to run the installer, and follow the instructions.
    When the installation is complete, the Java (TM) ME Platform SDK Device Manager icon (Java (TM) ME Platform SDK 3.2 Device Manager icon) appears in the Windows system tray.

Installing Oracle Java ME CDC Platform

  1. Choose Tools > Java Platforms.
    The Java Platform Manager dialog box displays.

    Java Platform Manager

  2. Click Add Platform.
  3. In the Select Platform Type step of the Add Java Platform wizard, select Java ME CDC Platform Emulator and click Next.
    The IDE displays the Choose Platform Folder step.
  4. Select the directory you installed the Java ME SDK Platform to (for example, C:\Java_ME_Platform_SDK_3.4) and click Next.
  5. In the Platform Name panel of the Add Java Platform wizard, ensure the platform you selected in the previous step is chosen and click Finish.
    The Oracle Java ME CDC Platform is now registered in Netbeans IDE.

    J2ME Platform registered

  6. In the Java Platform Manager dialog box, click Close.

Activating Java ME

  1. Choose Tools > Plugins from the main IDE's toolbar.
  2. In the Plugins dialog box, click the Installed tab and select Java ME in the list of available features.

    Plugins dialog box

  3. Click Activate.
    At the Welcome panel of the Installer dialog box, click Activate.

    Installer dialog box

  4. When the activation is successfully completed, click Finish.
  5. Click Close to close the Plugins dialog box.

Now your NetBeans IDE is set up for mobile development.

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 Interface.


Creating a New CDC Application - Personal Basis Profile

Here we create a CDC Application for the Personal Basis Profile (PBP) 1.1 Profile using the Oracle Java ME SDK.

  1. Choose File > New Project (Ctrl+Shift+N) from the main window.
  2. From Categories, select Java ME. From Projects, select CDC Application. Click Next.
  3. In the Name and Location page, name the project newcdc and leave the Create Main Class checkbox checked. Click Next.
  4. In the Select Platform page, leave the default settings - CDC Java(TM) Platform Micro Edition SDK 3.2 (Java Platform), DefaultCdcPbpPhone1 (Device), and PBP-1.1 (Profile) - like shown in the following picture.

    New CDC Project Wizard Select Platform Page

  5. Click Finish. The IDE creates a new application and opens the main class form.
  6. In the Source view, find g.drawString("Hello, World!", 80, 50); and add the word Java so that it reads Hello, Java World!

    The Source Code editor with the string Hello Java World!

  7. To build the project, choose Run > Build Project from the main toolbar.
  8. Choose Run > Run Project from the main toolbar to run your project.
    The project launches in the emulator and and displays the modified "Hello World!" message.

    The Default Color Phone Device Emulator with the message Hello Java World!

You can also debug the project and create tests for CDC projects using the JUnit framework.


See Also

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

get support for the NetBeans


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2015, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo