Skip to main content

Alive and kickin': Java on Windows Mobile

Posted by terrencebarr on April 22, 2008 at 8:58 PM PDT

WinMobile-JBenchmark.pngUpdate:

  • 7/27/09: JavaFX Mobile 1.2 EA for Windows Mobile released.
  • Here is another option for Java on Windows Mobile: Mysaifu JVM
  • As was correctly pointed out I forgot to mention CrE-ME as another option for running Java on Windows CE/Mobile. My oversight. Please find more information on CrE-ME here.
  • Davy Preuveneers is maintaining an excellent collection of ready-to-run binaries of phoneME Advanced for Windows Mobile.

Recently on the Java Champions alias some people were surprised to learn that Java has been available on WIndows Mobile for some time now. Obviously we aren't publicizing that fact enough ;-) so here we go:

The phoneME Advanced project open source repository contains a Java SE 1.4.2-compatible stack running on Windows Mobile. To be precise, it is CDC 1.1.1/FP 1.1.1/PBP 1.1.2/PP 1.1.2 which is the equivalent of Java SE 1.4.2 - including AWT and Applet support. This has been available for some time now (see MR2 announcement) and is being actively developed and improved. The screen shot shows JBenchmark2 running on phoneME Advanced on Windows Mobile 5.

What are people doing with it? Well, Java DB/Apache Derby runs well on phoneME Advanced and Hinkmond Wong, project lead of phoneME Advanced, spoke about it in a podcast last year. But not only can you run Java SE apps on this stack, you also have access to many of the optional Java ME JSRs, such as MIDP, PIM, SVG, and others. So you can also run many off-the-shelf Java ME apps on Windows Mobile.

And, of course, because the code is open sourced under GPLv2 and fully available and buildable from the open source repository you can play with it yourself. In fact, I've been talking about just that at Sun Tech Days and other events for a while (access my presentation here). Or download the binaries and install and run them right away. And, as usual, check the phoneME forums for more information and to ask questions.

I hope that clears it up. Java on Windows Mobile is alive and kickin'

Cheers,

-- Terrence

Comments

Terrence, I have tried to use the Mysauifu, but i don't find some informations that i need to develop for it. Could you help me? My project uses Bluetooth to emulate the Serial Port. I like Java, then I started to look for a VM for a WinCE or a Palm TouchScreen. I would use CDC, but I cannot. In the Palm, I have problems with the QWERTY keys. The Commands in J2ME use only the keys that have another function on the device, such the key that opens the main menu or the key that opens the Calendar of the device. I'm lost. I don't found any information that help me, and I look for it very very often. I'm a begginer in the J2ME World, then I 'm learning this. I don't found a CDC VM that supports Bluetooth. The setup of the Creme VM didn't run in my device (an HP iPAQ 200, with WinCe 5.0 OS). The MySaifu runs, but i have a problem: I don't find another information about the JSR that it supports. Could you tell me if Mysaifu supports Bluetooth connections? Thanks in advance -- Bruna Rocha, Student of Telematics

Cheers Terrence. A good URL. Looks like it's the Standard or Professional Versions. I'll try that. Many thanks for your assistance !!! John.

John,

I haven't tried building phoneME Advanced lately and the tools requirements might have changed. You can find the latest build information on the phoneME Advanced wiki: http://wiki.java.net/bin/view/Mobileandembedded/PhoneMEAdvancedGSGWinMobile

Hope this helps. Best,
-- Terrence

Hi Terrence. In your presentation "Programming for cool devices using the open source Java ME phoneME stack", it says one can install "Microsoft Visual Studio Express 2005 C++ (free)". I did that but the PocketPC 5.0 SDK doesn't appear to work with this - I think it works only for the Standard and Professional Editions which you have to purchase. I also looked at http://www.cs.kuleuven.be/~davy/phoneme/?q=node/12 which doesn't mention the express edition. Do I have to buy the Visual Studio Standard Edition to get phoneME Advanced working? Cheers, John.

naftoligug,

Java 5 and full java.lang and java.util support: The decision to limit the phoneME Advanced capabilities was made a few years ago when resources on devices were tight. As devices become more capable we're actively contemplating adding these features to phoneME Advanced.

For comparison of full Java 5 VMs see some of the VMs presented at FOSDEM a few weeks ago in the Java Libre Dev Room (http://wiki.debian.org/Java/DevJam/2009/Fosdem). You can get pretty good open source VMs (even optimized of ARM) - but they typically use an order of magnitude more memory (32 MB and more) compared to phoneME Advanced and have lower performance. So it's a trade-off. PS: If you want a Swing-like UI model optimized for small devices check out the LWUIT project http://lwuit.dev.java.net.

Sprint Titan: Works fine with CDC 1.1. In fact, Sun and Sprint are jointly working on an implementation. See: http://developers.sun.com/mobility/community/sprint-adp/downloads/index.jsp

Best,
-- Terrence

Also don't forget Sprint Titan.

The only thread I saw about it was my thread. IIRC Hinkmond basically said that Swing requires native acceleration that does not exist in AWT alone and therefore copy-pasting swing to phoneME won't work. He didn't point me to anything specific though. My main point is why can't phoneME support generics and the full java.lang and java.util.

naftoligug,

Sorry for the slow reply. There have been several threads on the topic of Java 5/6 byte codes and Swing on the phoneME Advanced forum lateely, for example http://forums.java.net/jive/thread.jspa?messageID=299096.

While I think it should be technically possible (and desirable, to some extent) to run Java 5 byte code on phoneME I am less certain about the benefits of running Java SE on mobile devices. Which part of Java SE do you really need? And which parts of that are already available as Java ME APIs and therefore would be duplication?

We hear developers asking fairly frequently for "desktop Java" on mobile devices but when we you start discussing individual functionality and the resource and UI tradeoffs the desire for full Java SE becomes a lot less obvious. As soon as you start making tradeoffs the result is not full Java SE anymore.

-- Terrence

Although Mysaifu has a long way to go, the advantage of it is that it's goal is to implement Java Standard Edition, like a regular PC. There's no reason why today's Windows Mobile devices shouldn't handle all those features. Also, it interprets 6.0 bytecode. There are two main disadvantages to Mysaifu: The main one is that it doesn't have a JIT. The second is that being a work in progress port of GNU classpath which is (or was?) itself a work in progress, the class library is very incomplete. But those are two distinct components - the VM and the class library. On the other hand, phoneME has a JIT for ARM processors. (I was doing some Java development on my phone. I made a little IDE using SWT and ran it in Mysaifu - I used Java 5 language features. But I programmed it to invoke the compiler in phoneME. A HUGE difference in compile time.) The class library subset that it has - Java ME - is implemented more fully. Also, phoneME seems to run 5.0 bytecode, just not 6.0. And then there's all of the Java SE class library that doesn't have native code. For example, AWT needs native code but Swing runs on top of it and is itself pure Java. So the question that interests me very much is, what would it take to get phoneME to run 6.0 bytecode, and give it an rt.jar (or a boot class path) that is a combination of the work done on the PhoneME class library plus the functionality that Mysaifu has over phoneME, plus everything in the Java SE runtime that's pure Java? It sounds like it wouldn't take all that much. What do you say?

nsicom, You're correct, I apologize for neglecting to mention CrE-ME. The blog was written with open source in mind but phoneME is certainly not the only Java ME platform available for WIindows Mobile. I will update the blog accordingly. -- Terrence

There is already a free open source Java SE for Windows Mobile - it's called Mysaifu JVM, and it uses GNU classpath libraries. It's a work in progress, but it works pretty well. It's in active development - bug reports are usually responded to pretty quickly.

naftoligug,

Thanks for the pointer! I'll update my blog.

-- Terrence

Hi Terece ...

Why is phoneME Advanced not implementing AGUI (JSR 209) ? This blocks advanced GUI design. Because, no, AWT is not a solution on Windows Mobile ;-)

At the end, I ask myself, why is there simply no JavaSE for Windows Mobile ? Today's platform are powerfull enough for it. This is a question to ask to Sun ! Java supposed to be platform independent and usually we expect the platform manufacturer to port Java (see OpenJDK). The problem is that we all known MS will never port OpenJDK to WinCE (WM or CE). There are some opensource effort in this way (port to ARM), but having support from Sun team would definitivelly help them !

Can anybody at Sun consider a Windows CE port of the JDK ? or at least of AGUI ?

I'm not a Java ME developer, so as an outsider I'm surprised that Java 5 isn't supported on mobile devices yet. Even more concerning is the very outdated JSR172, which provides RPC web service support. We don't use RPC anymore. AWT instead of Swing? (maybe that's not a big deal). This makes mobile development with Java seem forgotten and outdated. It seems behind .NET. I'm also hesitant to start a new mobile project where the target device is Pocket PC or Windows Mobile, and to use a JVM that is still under development. I'm happy to see that Sun is continuing work on this JVM, and that M2 now runs on Windows. Excellent work! Now lets modernize the JSRs and get with today.

Cool! Yet another reason for me to get a Windows Mobile device ASAP :)

Hello, please tell us why JSR 226 is not available in Advanced now? Do you plan to have phoneME Feature/Advance to be fully compliant with MSA JSRs set?

Terrence, you leave me puzzled. If you want to inform and help people who need CDC/Personal Profile, it has been alive and kicking for a long time in the form of the CrE-ME Java Virtual Mahcine (download at www.nsicom.com). CrE-ME is also based on Sun's reference code, but has certain CVM technology replaced by NSIcom's micro-kernel. The port was done years ago, and is mature. It really works, and runs hundreds of real-life deployed Mobile Applicaitons on Windows Mobile.

goodst0ry,

I am not an expert on the other stacks besides phoneME Advanced ... I haven't tried My saifu or CrE-ME yet myself so I can't really help much. Sound and media support is generally tricky as it requires tight integration with the native platform. Even phoneME Advanced currently has only very limited sound support.

-- Terrence

hey terrence. in the opening to this article you state Here is another option for Java on Windows Mobile. where can i find others. mysaifu doesn't work on my phone. also i can't set the options. i currently use jbed3dmod and it works great for gaming except there is no sound. i'm trying to find a program for gaming with sound. thanks.

dmitriy_zaitsev,

Actually, we have JSR 226 working on phoneME Advanced for Windows Mobile. But to build it there are some internal dependencies we need to fix - we plan to have it fully buildable in open source soon.
As for MSA compliance ... we are working on adding more and more JSR support. phoneME Feature MR will be available soon and has additional JSRs available.

-- Terrence

bjb,

AGUI and AWT: As I mentioned below there will be exciting announcements in this area very soon. Watch my blog.
As for full Java SE: This will be implemented with FX Mobile. More details at JavaOne.

-- Terrence

rdelaplante, Thanks for the comments. Couple of points: - Java 5 will be supported on the forthcoming FX Mobile platform. More details at JavaOne. - 172: Agree. There are new JSRs upcoming regarding web services. The easiest most immediate option is to use the Mobile Ajax library: https://meapplicationdevelopers.dev.java.net/mobileajax.html - AWT: Exciting announcements will be made very shortly. Watch my blog ;-) -- Terrence