Monday, October 27, 2008

LWUIT Makeover: SVG/MIDP & LWUIT

The LWUIT Makeover demo is an excellent tool for comparing the different approaches for building MIDP UI. While LWUIT's differences to MIDP are more clear to most, some people still have questions regarding LWUIT as opposed to SVG.
When compared to LCDUI the LWUIT interface is much richer and allows greater control, this will probably still be the case even in MIDP 3.0's timeframe since a lightweight UI by its very nature is more customizable than a heavyweight UI (as is the case in Swing vs. SWT/AWT). Another advantage in compared to current LCDUI is portability, LCDUI's custom items have quite a few portability and usability issues across devices which don't exist with MIDP...

The greater advnatages however are in MVC, the List in the demo is scrollable and fetches data only when necessary thanks to LWUIT's MVC support. This is far more intuitive and actually easier to write than odd paging mechanisms that are often necessary for such results! This is also just as efficient and arguably even more efficient than the typical paging algorithm.

When compared to SVG most of the same advantages still persist with some additional benefits. LWUIT is much faster than todays SVG devices, it is also far more portable, while writing cross device SVG code is not trivial the main problem is in the fact that many current devices still don't support 226 (newer devices from the major manufactures have finally stepped up to the plate). Basic tasks are often very difficult in SVG, things such as text input are not integrated and need programming. The separation of view and logic is very powerful in SVG but not very intuitive to program, it is also harder to draw elements on the fly in some cases.

Changing the look and feel in SVG is possible by replacing some image elements but it is not quite the same thing, features such as transitions etc. all have to be coded specifically for an application.

SVG is great when you need to do Flash like graphics applications, LWUIT doesn't ofer much in that department. When you need to build component based applications SVG isn't as capable as LWUIT (in my obviously biased opinion), however if you need to combine them we offer that ability via SVGImage which allows animations and DOM manipulation.

6 comments:

  1. Can we get the source code of this demo?

    Thanks!

    ReplyDelete
  2. I am working on this, but it needs some management permissions. It will probably not be published via the blog but in the LWUIT SVN tree as a demo.

    ReplyDelete
  3. shai, when will LWUIT UI designer be out. I am a great fan of LWUIT, but my ResourceEdit.jar is giving me errors on my Fedora machine. So i want to know when the UI designer will be out.

    ReplyDelete
  4. There should be no issues with the latest resource editor other than with pick MIDlet. Have you tried switching the look and feel using the look and feel menu?

    ReplyDelete
  5. I saw your Makeover demo project, in this you used progressIndicatior by using a small image like waitcircle. I used that functionality in my application. It works fine, but when we are going to change the mobile configuration, it show an IllegalArgumentException occurs. Pls, give me ur valuable suggestion on this-
    pls----------

    ReplyDelete