Skip to main content

Comparing LWUIT and JavaFX Mobile

Posted by terrencebarr on August 17, 2008 at 11:15 PM PDT

Update:

  • Also check out the LWUIT blog. In the comment section Shai talks about specific technical differences (search for "LWUIT Differs from Java FX")

Open sourcing LWUIT last week has created a lot of buzz - the response has been phenomenally positive. We've also gotten a few questions regarding the relationship of LWUIT and the upcoming JavaFX Mobile platform - there still seems to be a bit of confusion here. So I thought it would be useful to devote a "FAQ" blog entry to this topic.

FAQ: LWUIT vs. JavaFX Mobile

1. What is LWUIT?

LWUIT (Lightweight UI Toolkit) is a UI toolkit library for Java ME.

LWUIT is aimed at current Java MIDP and Swing developers who are looking to enhance the interfaces of new or existing Java ME applications on MIDP 2.0 devices. LWUIT offers pre-made graphical functions and features that developers can quickly and easily assemble into a compelling interface. LWUIT allows developers to worry less about the building blocks and instead focus on a consistent and richer interface across phones. As a binary library that developers simply deploy together with their applications LWUIT works on the vast majority of today's mobile phones and platforms supporting MIDP 2 (including Windows Mobile as described here) as well as MSA devices going forward.

In short, LWUIT is the solution for building attractive and engaging applications on mass-market devices today.

2. What is JavaFX Mobile?

JavaFX Mobile is a Java ME platform with the JavaFX runtime (including JavaFX Script) on top of it.

JavaFX Mobile is targeted at developers, designers, and scripters who are looking to create very rich, very immersive experiences across the "screens of your life" (phone, desktop, TV, etc.). The amount of interactivity, animation, and control over the user's screen brings a new level of functionality to devices. Java FX Mobile requires MSA-enabled platforms which comprise the small but growing higher end of the mobile space - smart phones and high end feature phones.

JavaFX uses JavaFX Script, a declarative statically typed scripting language that allows people to build out interfaces by describing the functionality that they want to see, instead of building it from the ground up. This lets them think creatively and be creative. JavaFX includes scalable fonts, 2D graphics, rich animations, integrated audio and video, and as noted, you can build apps that will run across all the screens of your life. In addition, with JavaFX, you can use design tools like Photoshop and Illustrator to build out graphical elements and even entire interfaces that you can directly build into and manipulate within JavaFX. This lets the designers and developers work much more closely and efficiently together.

In short, JavaFX Mobile is the next quantum leap for the mobile Java platform - coming to devices in 2009.

3. When do I want to choose LWUIT over JavaFX Mobile or vice versa?

LWUIT focuses on improving the UI experience on today's mass-market phones. If you have an existing MIDP application that you would like to spruce up or you need to create an attractive new application targeted for todays MIDP 2 and MSA devices then LWUIT is your ticket.

If you're looking to the future and you want the dynamic capabilities and ease of development of the JavaFX Script language as well as immersive media and graphics then JavaFX Mobile is what you'll want. The JavaFX Preview SDK is available now so you can start experimenting with FX Script today and get ready for when JavaFX Mobile becomes available.

4. Does LWUIT compete with JavaFX Mobile?

No.

Superficially, there are some similarities as both of these products address a better and more compelling user interface for mobile and other devices. But it should be clear from the above that there's really two target audiences and device profiles that are being addressed. Furthermore, since LWUIT will continue to run on MSA-compliant platforms (MIDP 2 is a required component of MSA) LWUIT will not be obsolete when JavaFX Mobile becomes available.

In short, having both options available makes the life of developers easier because they can choose the model that fits their requirements best and create compelling content for Java ME today and the future.

Hope that clears it up. Cheers,

-- Terrence

Comments

dougrosenberg,

The Java ME MSA platform is an essential part of FX Mobile - so learning Java ME is still necessary.

-- Terrence

Mixing JavaFX and JavaME

Is it possible to mix both JavaFX UI/Script with JavaME API or 3rd party libaries.. some thing like groovy wiht java or java with groovy on either way.. Also, how about mixing UI provided by LWUIT with UI of java fx either on different screens of one application or on same screen of the application.. Regards, Raja Nagendra Kumar, C.T.O TejaSoft

If I'm just starting to learn Java for Mobile Applications, should I skip JME and go straight to JavaFX Mobile or is it essential to learn JME anyway?

LWUIT in it's latest release supports SVG .. check the announcement on the LWUIT blog. Vector graphics in general a key technology for delivering rich graphics. JSR 226 is a mandatory part of MSA and ... I don't see it going away any time soon. Design of SVG images, in particular SVG Tiny images, is a bit of a problem as tools are lagging demand. But I think that is just a temporary situation.

JavaFX Mobile is more of a vector graphics platform, not a component model framework like Swing. If you want the Swing paradigm then LWUIT is the way to go - it was inspired by Swing and has many of the same concepts and similar APIs. Swing itself was deemed to heavyweight and not appropriate for the mobile space. Remember that you probably don't want to run unmodified Swing apps on your mobile device even if you could due to the very different UI and resource requirements/constraints.

Hope this helps,
-- Terrence

Does JavaFX Mobile include Swing? ie. can you write/deploy Java/Swing apps for JavaFX Mobile ie. today's "desktop" Swing apps?

Hi Terrence, And about SVG? What you think about the future of JSR-226? Unfortunatelly we don't have tools and framework to do a better work with SVG images... All the best...

psynixis,

Hmm, good question - I am not sure that has been answered yet. FX Mobile is still in flux but my hunch is because it aims to be a rich platform it will require more than just the MSA subset.

-- Terrence

Terrence, nice post! One question: when you say JavaFX mobile requires MSA i.e. JSR 248, does that mean both sets of JSR 248 APIs, or just one? That is, will Java FX Mobile require the "Mobile Service Architecture" APIs, or will it also work with the "Mobile Service Architecture Subset" APIs?

>Does LWUIT compete with JavaFX Mobile?No. It is lier: Does Swing compete with applet ? NO Does CLDC compete with CDC? NO so, java can run enywhere?