Created on 02  JUL 2006

Updated on 08 OCT 2006

HOWTO run SWT app on PocketPC Emulator:

 

A brief HOWTO precisely. Maybe I will make it more expansive in the future, but I think this form will do combined with the linked materials.

 

I. Required software:

  1. Download MS Device emulator v1
    1. Emulator: http://www.microsoft.com/downloads/details.aspx?FamilyID=C62D54A5-183A-4A1E-A7E2-CC500ED1F19A&displaylang=en
    2. OS Images (I used Windows Mobile 5.0) http://www.microsoft.com/downloads/details.aspx?FamilyID=eec33ae3-c129-4c25-abaa-18e8e842178f&DisplayLang=en
    3. Virtual eth switch: http://www.microsoft.com/downloads/details.aspx?familyid=DC8332D6-565F-4A57-BE8C-1D4718D3AF65&displaylang=en
    4. Active Sync: http://www.microsoft.com/downloads/details.aspx?FamilyId=4C254E3F-79D5-4012-8793-D2D180A42DFA&displaylang=en
  2. Get j9 JVM for emulator
    1. WebSphere Everyplace Micro Environment Trial and Evaluation Runtimes (I used WEME 6.1 CDC 1.1 Foundation 1.1 Personal Profile 1.1 for Windows Mobile 5.0 ARM) http://www-128.ibm.com/developerworks/websphere/zones/wireless/weme_eval_runtimes.html
  3. Get swt library swt-3.1-win32-wce_ppc-arm-j2se (not j2me) http://download.eclipse.org/eclipse/downloads/drops/R-3.1-200506271435/index.php#swt
  4. Get Netbeans with Mobility Pack for CDC (+UIQ3SDK, +Sony CDC Platform, +M600, +P990) http://www.netbeans.org/kb/50/quickstart-mobility-cdc.html

 

II. What to do:

  1. Install Java and NetBeans with CDC, UIQ3SDK, Sony CDC Platform and all extensions. It is the most complicated part, but best documented on the internet. Use http://www.netbeans.org/kb/50/quickstart-mobility-cdc.html as a starting point. You should install all components, then configure UIQ3SDK/SDKConfig (select device and style i.e. P990 CDC). Then go to NetBeans, select New Project, CDC Application and add UIQ3SDK Platform. Finally you should be able to run NetBeans CDC Project on M600 and P990 emulator.
  2. Install Virtual ethernet switch, MS Device Emulator and Active Sync. The installation is straightforward. To enable Active Sync to connect to emulator open All Programs/Windows Mobile 5.0 ....../Device Emulator Manager and do Actions/Cradle.
  3. Install j9 from WebSphere Everyplace Micro Environment – follow the guide which tells you to unzip and copy bin, lib and examples to PPRO11 folder on your Pocket (through Active Sync). Check if example application is working.
  4. And now goes SWT library. It is the easiest part, but worst described on the net. Unzip swt-3.1-win32-wce_ppc-arm-j2se.zip. Copy the swt.jar file from inside the distribution to \j9\PPRO11\lib\jclFoundation11\ext in your device, and the swt-win32-3138.dll or newer version to the \j9\PPRO11\bin  folder in your device. Should work now J If not try adding the folder with contents org\eclipse\swt\*.* from swt archive to the jar: \j9\PPRO11\lib\jclFoundation11\ppro11\ppro-ui.jar
  5. Now you can write SWT application in NetBeans. After compiling you get a JAR file in distribution folder. I copy this file to \j9\PPRO11\myapp\ folder. Then you need to create a link to start application. Refer to examples that came with j9. For a file HelloSWT.jar I use the link with contents: 255#"\j9\ppro11\bin\j9w.exe" "-jcl:ppro11" "-cp" "\j9\ppro11\myapp\HelloSWT.jar" "test_pack.OkButton" where test_pack is the name of package and OkButton the name of java class.

 

III. Tips:

  1. It takes long time for Windows Mobile to start. Be patient.
  2. Starting Device Emulator causes my internet connection to collapse or recycle. Similar when starting Active Sync or cradling emulator.
  3. Active Sync does not connect to the cradled device automatically as it should. I click its tray icon with right button and choose Connection Settings and then Connect. It manages to connect this way. Sometimes for the third time unfortunately.
  4. Regardless of what online tutorials say I have not found SWT as a part of any j9 I downloaded as a part of WebSphere Everyplace Micro Environment (tried 4 versions).

 

IV. Links:

  1. Configuring Java (J9) on a Pocket PC with RMI and SWT using CDC Personal Profile: some experiences and issues

http://awareness.ics.uci.edu/~rsilvafi/pocketPC/index.html

The most useful link I found. Helped much.

  1. Developing Java applications for Pocket PCs using NetBeans - a dream or reality?

http://blogs.sun.com/roller/page/bblog?entry=developing_java_applications_for_pocket

A guide how to develop for Pocket with Netbeans. Helpful, but I couldn’t make it work this way.

  1. Fair And Biased: Java on PocketPC (Unofficial FAQ)

            http://blog.vikdavid.com/2004/12/java_on_pocketp.html

About JVMs on Pocket. Good for introducing the topic.

  1. Introduction to Pocket PC Development
    http://www.codeproject.com/ce/Pocket_PC_Development.asp

An overview of Pocket PC development, including information on development tools and languages available. 

  1. A small cup of SWT

http://www.eclipse.org/articles/Article-small-cup-of-swt/pocket-PC.html

A bag of hints, tricks and recipes for developing SWT apps on the Pocket PC

  1. Getting Started with Eclipse and the SWT

http://www.cs.umanitoba.ca/~eclipse/

A set of good tutorials

  1. Eclipse FAQ regarding SWT and PocketPC

http://www.eclipse.org/swt/faq.php#pocketpcstart

  1. First Pocket PC SWT App

http://blogs.bytecode.com.au/glen/2004/11/15/1100468897135.html

Comments from a guy who have made it running and other people