Friday, May 23, 2008

LWUITDemo in only 123kb JAR!

The LWUIT demo which we have been showing around for some time is often quite hefty (500kb without obfuscation and 300kb with) we often say that most of the size is taken up by resources but due to complexity we didn't want to go into the trouble of removing them...
What I did today was just that, I refactored all usage of resources and made them downloadable on startup. If the demo can't find the resources locally then it goes to a download URL and fetches them to RMS. I have some odd deployment problems with my server but the jad/jar seem correct since I was able to beam the jar to my Nokia for testing.
This is the jad url and this is the jar url.
This is the exact same full blown LWUIT demo in 123kb, the size was so small it even surprised me!
BTW I also added a couple of features and fixed some bugs since this is based on a newer LWUIT snapshot. Notice that I added a feature suggested on the list for applying the list cell renderer (in the renderer demo) to the menu. The screenshot in this post shows the menu with a fisheye cell renderer installed, very cool effect!

Update by Shai: Fixed the JAR URL which was broken.


  1. Hello dear i am also working on CLDC/MIDP 2.0 app development and i have worked with RMS etc. i want discuss further thing with you such as testing, compatibility and deployment issues.

  2. kinldy contact me on my email yasirmturk at gmail or add on msn silverturk at or yasirmt2002 on yahoo .

  3. while i tried to download you app on my Nokia 6303 i got .EXT files instead of .jad and .jar :s

  4. Hello Shai,

    I'm using Netbeans 7.0 with LWUIT 1.4 and my current app size is 717 kb. After obfuscated with level 8 the size is reduce to 500 kb. How to optimized obfuscate my app below 200 kb like yours LWUITDemo?

    Thanks in advance

  5. Hi Shai,

    Thanks for your direction, i will try it now :)