corner imagecorner image
FeaturesPluginsDocs & SupportCommunityPartners

Deploying Mobile CDC Applications Using the CrEmeVM in NetBeans

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 Java Virtual Machine (JVM) than MIDP-based mobile phones, which typically have 128 to 512KB of memory and use the Connected Limited Device Configuration (CLDC). This tutorial shows you how to use NetBeans IDE to create a Java Micro Edition (Java ME), Connected Device Configuration (CDC) application for deployment on a Windows CE device using NSICom's CrEme Virtual Machine. 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) and the Java Standard Development Kit (JDK) version 5.0 or 6.0 (download) installed before you can start. You also need the Sun Java Toolkit for CDC or other CDC emulator platform installed and registered in the IDE to develop CDC applications. See the CDC Emulator Platform Setup Guide for more information. If you are new to NetBeans Mobility, you should start with the NetBeans Mobility CDC Quick Start Guide before continuing.

Adding Emulator Platforms

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

The following emulator platforms and tools are required for this tutorial:

Sun Java Toolkit for CDC 1.0. ( see installation instructions) CrEme VM for Windows CE Windows CE Device emulator and supporting images ActiveSync

Creating a New CDC Application for Windows CE (Using the CrEme VM)

The NSIcom CrEme VM enables you to create and run Java Swing applications for devices running Windows CE.

Creating an Application

Choose File > New Project (Ctrl+Shift+N) from the main window. Under Categories, select Mobility. Under Projects, select CDC Application. Click Next.

Creating a new cdc project in NetBeans IDE

In the Name and Location Page, name the project cremeapp. Click Next. In the Select Platform Page, choose pJSCP V4.10. Click Finish.

Selecting the CrEme VM in the IDEs new project wizard

In the Project window, right-click on the Source Packages node of your project and choose New > JFrame form. Click Finish. The NetBeans GUI Builder (Matisse) displays the new form.

[image]

Note: Make sure that the first fragment of code in the main() method is as is shown below when you are going to run the application in CrEme default emulator. This make sure that Swing is loaded.

try {
    UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());} catch(Exception exception) {
    System.out.println("Error loading L&F: " + exception);
} 

Use the Project Matisse GUI builder to create your application. You can use the Project Matisse GUI Builder in the same way you use it for regular J2SE development.

Note that if there is an exception that crashes the emulator, the emulator prints it to the standard output window and waits for a key press. You cannot, however, send the keypress from the IDE. You must instead kill the VM from the Process Explorer.

Compiling and Running the Application on a Device or Emulator

Connect your mobile device using cable or Bluetooth. If you have a device, skip to Step 12. If you do not have a device, install the Microsoft Device Emulator and the Virtual Machine Network Driver for the Microsoft Device Emulator as described in the NetBeans Mobility Pack for CDC 5.5.1 Installation Guide. Then follow steps 2 through 4. If you do have a device, skip to Step 5. Start the Microsoft Device Emulator by choosing Start > Programs > Microsoft Windows Mobile 5.0 MSFP Emulator Images > Pocket PC Coldboot. This opens the Pocket PC emulator. [image] Choose Start > Programs > Microsoft Windows Mobile 5.0 MSFP Emulator Images > Device Emulator Manager. This opens the Device Emulator Manager. [image] In the Device Emulator Manager, choose Actions > Cradle. Open ActiveSync by clicking on the icon in the Application tray. If you do not have ActiveSync installed, download and install it as described in the NetBeans CDC Emulator Platform Setup Guide. When you open ActiveSync, it detects and connects to the device or the device emulator. If it does not:
Click on the ActiveSync icon in the Application Tray. Choose File > Connection settings. Do one or both of the following:
Check the Allow connections to one of the following check box and select DMA for the emulator, or USB or port number for a real device. Choose Run Connect which should detect the device automatically.
Download and install the CrEme VM on your device (download). Double-click on the downloaded file. It install both on your PC and your device. Download and install Swing extensions (CrE-ME410_swing.CAB) for your device from NSIcom (download). To install the Swing extensions on your device or device emulator:
In the ActiveSync dialog, choose Tools > Explore Device. The Mobile Device opens in an Explorer window. Copy CrE-ME410_swing.CAB into the Explorer window. In the device or device emulator, choose Start > Programs > File Explorer. Start CrE-ME410_swing.CAB.

Running the Application

Right-click the project and choose Properties. The Properties page opens. Under Categories, choose Running. Choose the NSIcom tab and check Run in remote VM. Click OK to close the Properties page. [image] Choose Run > Run Main Application.

See Also

In addition to the IDE's built-in help documentation about Java ME CDC development, tutorials and articles about using NetBeans for mobile development can be found at the following location:

Bookmark this page

del.icio.us furl simpy slashdot technorati digg
Companion
Projects:
MySQL Database Server   GlassFish Community: an Open Source Application Server   Open Solaris  Open JDK: an Open SourceJDK   Mobile & Embedded Community     Sponsored by 
Sponsored by Sun Microsystems


You are viewing a mobilized version of this site...
View original page here

How do you rate mobile version of this page?

Mobilized by Mowser Mowser