I have been developing Advanced Swing GUI for seven years now.
The time has come to write some to Pocket PC, and it doesn't look good.
I've searched the net for a mere beginners-guide and found nothing
there is no single A-to-Z tutorial which will tell you what to download and how to write you first program.
I am offering 15 Duke dollars for the kind member that will be kind enough to write a short "idiot's guide for writing a little gui app for pocket pc" post, including exactly what to download, how to configure, and what to write.
Coming from a swing background, you would be better off with a CDC implementation rather than a MIDP one.
CDC will give you awt, which has basic versions of many of the swing components, the major two missing in my book are JTable and JTree, however awt versions of these can be sourced on the web.
IBM have a free trial of their CDC VM called J9, for Pocket PC... it's a good starting point.
There CDC is based on version 1.0 of Personal Profile, where as IBM's is based on 1.1 but they don't have Swing... so you'll have to decide there.
There is a JSR (209) which is the offical Swing for mobile devices, the only place it is implemented yet is on the SavaJe mobile phone.
If you use Netbeans as an IDE you can get a addon module to develop with this API.
For generally writing of apps for Pocket PC, you can use your normal IDE, I use Netbeans, and you do nothing different than you would for a normal app, just don't use javax.swing... copy it to the device and it runs.
TIP: when you download the J9 VM make sure you get the ARM binary, as many people seem to download the win32 version and install it on the Pocket PC device for some reason.
Re: Beginner Guide for developing GUI for Pocket PC
Jun 2, 2006 7:13 AM
(reply 3
of 20) (In reply to
#2 )
Hi mo@mo@
Firsrt, thank you for your help.
1.
If I understood you correctly, you suggested two types of VM's : IBM and NSI
I went for the IBM one - and didn't have a clue what to choose:
- on the main page there are 3 option, I took the last one...
- There, I has 10 (!) different download packages... just too the first...
NSI offered 3 types of download, i took the first (left-most link).
It's an exe, probably a VM installer for PPC (wont run on my XP..)
IBM's is more robust - their PDF says what files should go to the PPC, dont they have a standard install??
2.
Let's say I wrote a simple 'Hello World' app (AWT) - with Notepad...
Now I need a JDK to compile, which JDK??
And after that, just copy the .class file to the PPC and run? as in: java.exe foobar.HelloWorld
Re: Beginner Guide for developing GUI for Pocket PC
Jun 2, 2006 8:20 AM
(reply 4
of 20) (In reply to
#3 )
Hi mo@mo@
Firsrt, thank you for your help.
1.
If I understood you correctly, you suggested two
types of VM's : IBM and NSI
I went for the IBM one - and didn't have a clue what
to choose:
- on the main page there are 3 option, I took the
last one...
- There, I has 10 (!) different download packages...
just too the first...
you what the 6.1 version of WEME from the first list,
then you want the ARM CDC PP 1.1 version from the next list, the file name is;
ibm-weme-wm50-arm-ppro11-6.1.0-20060321-073315-939.exe
NSI offered 3 types of download, i took the first
(left-most link).
It's an exe, probably a VM installer for PPC (wont
run on my XP..)
did not install on mine either;
trick is;
copy creme cab file from active sync folder "c:\Program Files\Microsoft ActiveSync\NSIcom" to the device and install it. I just open the cab on the device and it install it all.
IBM's is more robust - their PDF says what files
should go to the PPC, dont they have a standard
install??
no, the dist they supply has the lot, sources and all. you do not need everything on the PDA much of it is optional, to keep resources down you can only install the bits you need. The docs are pretty good, they say what the min is you need. I create a subset of what is in the dist folder on my pc in a /j9_inst folder, and just copy that directly onto the device via activesync browser.
2.
Let's say I wrote a simple 'Hello World' app (AWT) -
with Notepad...
Now I need a JDK to compile, which JDK??
And after that, just copy the .class file to the PPC
and run? as in: java.exe foobar.HelloWorld
1.you compile your classes as normal with the standard javac tool, use 1.4 or lower
2.jar up the classes and copy the jar to the PPC.
3. create a shortcut for running the app in notepad, call the file "hello.lnk"
it should look a bit like this one of mine;
i put my own jar file in the \my documents folder as it makes it easy to desploy using the auto sync option of active sync. I also installed the J9 on my flash to free up space on the device.
3.
Do you know of any PPC emulators?
you don't need one, it just runs normal desktop code and you app is a Frame just like desktop J2SE and started with a main(). So you just use the normal java.exe to run it with a Frame as you top level component.
4.
Is there any free VM for PPC?
Yes, they are a few but none of them are good enough yet i would say, and the IBM one is only $10 or less, so it is really the best way to go
Guide to installing and using CrE-ME JVM on a Handheld device:
Step A: Where to download the CrE-ME JVM from?
1. NSIcom.com has a 30-day free trail version of CrE-ME JVM and can be downloaded from the following link by clicking on ?Download Free Evaluation?:
http://www.nsicom.com/Default.aspx?tabid=159
The version I downloaded was CrE-ME 4.1
2. To download additional specific packages for applications that use SWING, RMI, etc. Click on ?View all downloads? and download from the packages listed.
Step B: Installing the JVM.
1. Connect the device to a desktop.
2. Install the CrE-ME version downloaded as you install any other application on your desktop.
3. While installing, the installer program will ask if you want to install at the default location or to specify a path. (I guess installing to the default location will make life easier). Therefore, the JVM will be installed on the handheld device.
4. Copy the additional packages downloaded to "\Windows\CrEme\lib" directory on the handheld device. Double click on the package (.CAB) file and it will configure itself.
5. Test the sample applications given in ?\Windows\CrEme\demos\? to check the proper installation of the JVM.
Step C: Executing your applications.
C.1 Method 1
1. Write and compile the program in any IDE but remember to compile the programs with jdk1.4 as CrE-ME 4.1 supports JDK 1.4 or earlier.
2. Create a jar file of your application.
3. Write a link file (.lnk), specifying the classpath and the CrEme exe file in the following format:
255#"\Windows\CrEme\bin\CrEme.exe" -Of -classpath <full JAR file path> <main class name>
Ex: 255#"\Windows\CrEme\bin\CrEme.exe" -Of -classpath ?\My Documents\Menu.jar? Menu
-Of is used to redirect the console output to be redirected to jscpout.txt file located in the root directory of your device. Use -Ob if you are using a console based application.
255 specifies the number of characters in the file, but instead of counting the characters you can use 255 which is the maximum (in general, it is seen that a higher value works but not a number less than the number of characters)
Also note that the classpath is in single quotes
4. Copy the link file to the handheld device and then double click on the link file to run the application and if the application doesn?t show up, you know where to look for the errors. The jscpout.txt file created in the root folder of your device due to the ?Of parameter used in the link file, will contain the console output and thus the errors.
C.2 Method 2
1. Write and compile the program in any IDE but remember to compile the programs with jdk1.4 as CrE-ME 4.1 supports JDK 1.4 or earlier.
2. Create an executable jar file of your application using the Manifest.mf file to specify the main class.
Ex: Main-Class: <main class name>
Also remember to hit the return (enter) key at the end of manifest file.
3. Copy the jar file to the handheld device and double click on it to execute.
4. In case the output doesn?t show up, it could mean that there were errors executing the application and to check for errors use Method 1.
Re: Beginner Guide for developing GUI for Pocket PC
Jul 22, 2006 3:31 AM
(reply 8
of 20) (In reply to
#7 )
Hi, i too want some information's on developing java applications for Pocket PC / Windows Mobile 5.0
I think IBM is providing a "J9" VM for Pocket PC / Windows Mobile 5.0
with CDC 1.1/FP 1.1/PP 1.1
still i have not tried the J9 VM on the device.
I have download developer kit , for developing pocket PC application from website that come with the same JVM.
you can download the developer kit from the link,
(NOTE:You should register for free for this.)
I am interested on downloading the developer kit from the link you put above, I loged in with my IBM account but says I need to register for this offer before.
Could you give me the link where you applied for this ^^.
Re: Beginner Guide for developing GUI for Pocket PC
Jul 25, 2006 1:23 AM
(reply 11
of 20) (In reply to
#10 )
Hi Saro,
Ok I have a few questions for you,
What you downloaded from the link is the developer kit with the JVM AND the IDE to develop for this JVM, right??? or just the J9 JVM, because I am interested on getting the IDE.
Now I tried again the link, and I am getting this message:
Error >
IBM WebSphere Studio Device Developer downloads
You have not signed up for this offering. Please complete the signup process before coming to this page.
message code: 45e
Note: when I get this message I am logged in with my account,
but I guess it doesn't work for me because I havent applied for this offer,
what did you mean't by: (NOTE:You should register for free for this.)
Have u got any tutorials for developing CDC applications using AGUI optional pakage. If so please let me know. Any recent articles on Developing CDC appln for POcket PC / Windows Mobile 5.0
Re: Beginner Guide for developing GUI for Pocket PC
Aug 8, 2006 6:29 AM
(reply 13
of 20) (In reply to
#12 )
More people appearantly are starting doing Java on PPC, so I won't feel so alone any more. ;-)
I've tried building a GUI on PPC using several libraries:
- thinlets work ok, but are slow
- swing 1.1.1. (download from Sun) immediatly go into exceptions
- AWT works, on J9 WINDOW_CLOSING event is not send on Frames
- SWT I got a lot of problems getting the binaries right, and I'm a sucker for "100% java" (or as close as I can get)
My major issue right now is the fact that J9 does not send the closing event.
I'm trying to run CrEme, but (bright as I am) I installed it before my vacation and now that I have time for it, it expired. So I'm in discussion there.
I recently started to investigate how to program for a PPC. I managed to star t a HelloWorld app. My questions so far are related to starting a jar file.
1. Is there no way to associate j9.exe or j9w.exe with jar files so jar files would run just as any other application ?
2. If a shortcut has to be created, like the one quoted above, is there no way to use relative paths?
3. In the shortcut, everything has to be inclosed in quotes ? I understand the path have to be, because f the spaces that may appear, but arguments like -cp ? I find no reason to enclose them in quotes.
Thanks !
This topic has
20
replies
on
2
pages.
1
|
2
|
Next »