[RSS]

NOTE - this tutorial has not been tested using the Mobility 6.0 release

Fun with CrEme Applications (Running Applications remotely in CrEme VM)

by PCM Reddy

The following procedure demonstrates how to run a Connected Device Configuration (CDC) application on a Windows Mobile device running the CrEme VM with NetBeans IDE.

Creating user interfaces with NetBeans Mobility Pack 5.5 for CDC is made easier thanks to Project Matisse, the NetBeans GUI Builder. This document shows you how to create a login screen for CDC devices using two of the emulators available for the Mobility Pack for CDC. The Nokia and Sony Ericsson emulators included in their respective SDK's both use the AWT-based JSR-62 standard for Personal Profile 1.0. Device support for AGUI-backed SWING as defined in JSR-209 is still limited, but for this demonstration the Sun Java Wireless Toolkit emulator bundled with the CDC pack is sufficient. It's important to understand that AGUI and Personal Profile have nearly identical capabilities for creating GUI's. The reason for using one or the other depends on which device your application is deployed on.

Prerequisites:

This tutorial assumes you have some basic understanding of, or programming experience with, the following technologies:

  • JavaME programming experience
  • CrEme VM environment on Pocket PC

Software Needed for the Tutorial:

Before you begin, you need to install the following software on your computer.

  • NetBeans Mobility Pack for CDC 5.5.1 download

This tutorial assumes your system has Windows XP, JDK 1.6, NetBeans 5.5.1 and Mobility Pack for CDC 5.5.1 installed. You also need to install NISCom's CrEme VM http://www.netbeans.org/community/releases/55/1/mobilitycdc-install.html#emulators on both desktop and on your Mobile PC. Make sure your device is connected to the computer where NetBeans 5.5.1 CDC Pack is running. In this example, a USB cable was used to connect the Desktop PC to the Windows Mobile Phone.

Setup and running application

1. Start NetBeans IDE. Make sure NISCom <http://www.nsicom.com/> CrEme VM <http://www.nsicom.com/Default.aspx?tabid=138> is added to Java Platforms)

2. Connect your Windows Mobile device to the machine where you are running NetBeans ( I used USB cable to connect)

3. Create a CDC application select pJSCP V4.10 platform, uncheck creation of visual form. (See CDC Quick Start for details.)

4. http://blogs.sun.com/pcmreddy/resource/niscomsettings.JPG

5. Select Project and click on properties

6. Select platform and click on "CrEme" tab in right side panel.

7. Check option Run in Remote VM as shown in picture. (If there is a problem, NetBeans displays the error message in this screen)

8. http://blogs.sun.com/pcmreddy/resource/niscomsettings.JPG

9. Add AWT form add your components. (or you can use attached application sources).

COMMENT
I'd recommend to use the CDC/Creme specific template. You can find it in New Files wizard in CDC | JFrame Form
cdc-creme-template.jpg

10. Compile and deploy to target device.

11. Check application is deployed on device using file explorer on the device.

12. Now select the project and run the application.

13. On the Mobile device NISCom CrEme VM loads a splash screen will appear and application starts on device.

14. Once application exits, NetBeans run process stops and there will be an out put message in out put window.

I created a simple temperature conversion application which converts temperature from Fahrenheit to Celsius. I am able to run this application on a Cingular 8525 http://business.cingular.com/businesscenter/8525/index.jsp (which is same as HTC TyTN http://www.europe.htc.com/products/htctytn.html) from NetBeans.

Got Questions?

COMMENT
There is mailing list dedicated to Mobility Pack - users@mobility.netbeans.org. The FAQ for Mobility - http://wiki.netbeans.org/wiki/view/NetBeansUserFAQ#section-NetBeansUserFAQ-JavaMEMobility

Got Issues?

http://www.netbeans.org/community/issues.html

Troubleshooting :

  • If application is not deployed to device or not able to run the application. Check connections.
  • If application is failed to run. Check log file created by CrEme VM on device.

Summary:

In this exercise, you learned how to perform the following tasks:

  • Creating CDC application in NetBeans.
  • Setting deployment platform to CrEme VM platform.
  • Compiling and deploying to target platform
  • Configuring NetBeans IDE to run applications in Remote VM
  • Running application with trace enabled.

You can also watch this video, which shows an application created in NetBeans running on a device.

Resources for further reading:

Attachments

app-on-handset.jpg Info on app-on-handset.jpg 135829 bytes
application.jpg Info on application.jpg 68174 bytes
apprunninginemulator.jpg Info on apprunninginemulator.jpg 39010 bytes
cdc-creme-template.jpg Info on cdc-creme-template.jpg 43866 bytes
code.jpg Info on code.jpg 116328 bytes
mycremeapp.zip Info on mycremeapp.zip 14487 bytes
platform.jpg Info on platform.jpg 57246 bytes
remotevmsettings.jpg Info on remotevmsettings.jpg 38821 bytes