Archive for November, 2004

Shrinking the size of your Java MIDlets

As you add more code and graphics to a MIDlet suite the resulting size of the MIDlet jar will increase. The HyConExplorer/J2ME MIDlet suite reached last week a size of ~260KB. PNG graphics was over a 100KB alone. So I decided to try to shrink the size of the jar-archive.

All of the PNG graphics in the project were created (mainly based on Jimmac’s Gnome icons) in Adobe PhotoShop. There were about 30 files with an overall size of over 100KB. To decrease the size of the files I tried a program called Pngcrush. Pngcrush is a small command-line tool based around GNU’s libpng and zlib. Running Pngcrush on the files reduced the size to 52KB—about half the size of the PhotoShop versions (and the size reduction is of course completely lossless wrt. the image data).

After this success it was time to reduce the size of the Java Class files. I had tried Proguard before as it is integrated into EcplipseME, but had not have much luck with resulting files. There seemed to be missing some classes in the Jar after the Obfucating process. However, I had missed one important command line option to Proguard:

-dontusemixedcaseclassnames

If Proguard is used on a platform with a case insensitive file system this option must be used otherwise the generated class files will override each other (e.g. class ‘x’ will override class ‘X’).

After this small discovery Proguard worked like a charm, and the final jar produced with tools was only ~130KB. So with out changing a single line of code I reduced the size of the package to about half the size of the original jar archive… Great tools!

HyCon idea discussed

Well, somebody is reading conference proceedings! F.J. van Wingerde (a Senior Research Engineer from Nokia Research Center Burlington, MA, USA) has read our Hypertext paper: “Integrating the web and the world: contextual trails on the move” and has the following comments:

“Well, doesn’t this paper have it all. Mobile computing using both tablets and Nokia 3650 phones, using SVG to make a scalable interface, authoring location-based annotations and content in the field itself, browsing other people’s annotations and previous trails, computers aware of their locationby using GPS modules indexing new generated content automatically for the location, SOAP, Web services, and XLink, and JAVA as enabling technologies. Wuite the complex system to allow people to create and retrieve data for themselves and others depending on where they are. uses suggested are for example leaving a restaurant review that others would encounter on their own mobile devices when they go near the restaurant. Users can annotate the annotations, thus creating location-based discussions.

Probably because it is such a prototype system, there is very little discussion of usage or user satisfaction. The description of one of the systems users can lug around consist of a tablet PC with a camera, a GPS receiver, and a mobile phone for connectivity; all in all not a nice clean package to lug around. The battery time alone can’t be too luxurious. Still, it would have been nice to know if all this effort was actually already leading to any kind of interesting experience that would energize researchers to examine this more and create better systems.”

I think it’s a fair critique. Hopefully, the experiences with HyConExplorer/J2ME will address most of his points.

Read the post at Blogspot

HyConExplorer/J2ME ready to fly!

The first prototype of HyConExplorer/J2ME for SmartPhones are now finished and ready to be tested. The prototype runs on Java devices supporting CLDC-1.0 and the MIDP-2.0 profile. HyConExplorer/J2ME also requires the BlueTooth API’s for Java (jsr-82) if it is used with a BlueTooth GPS.

I’ve created a Web page with download links to the software:
http://www.daimi.au.dk/~fah/hycon/html/