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.
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.
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:
Instructions for adding the following supported emulator platforms are listed in the NetBeans CDC Platform Emulator Setup Guide.
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.
Here we create a CDC Application, or Xlet, for the AGUI Profile using the Sun Java Toolkit for CDC 1.0.
newcdc. Change the Main Class name to newcdc.Mainxlet. Leave the Set as Main Project and Create Main Class check boxes checked.Sun Java Toolkit for Connected Device Configuration for the Java Platform and DefaultColorPhone as the Device. Leave the Profile settings as it is.
Click Finish. The IDE creates the new application and opens the main class form in the 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.
You can also debug the project, and create and debug tests using the JUnit framework.
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.
In the Select Platform Page, choose the Nokia S80 Platform.
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.
![[image]](http://mowser.com/img?url=http%3A%2F%2Fwww.netbeans.org%2Fimages%2Fmobility%2F60%2Fcdcqs%2Fnokia-screen.png)
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.
Here we create a CDC Application, or Xlet, for the Foundation Profile using the Ricoh Embedded Software Architecture Emulator 1.14c.
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.More information about developing mobile applications using the IDE can be found at the following locations:
You are viewing a mobilized version of this site...
View original page here