Tuesday, September 30, 2008


There is a great number of different screen resolutions out there. Bellow you can see various sizes, from the oldest 96x54 to the new 240x320. And these are not all of them. A more complete list of handsets and their screen resolutions can be found at MIDP Benchmark.

So how can a Java ME application behave properly on so many different handsets? Use the standard UI classes: LCDUI.
Ok, LCDUI is not appealing. Programmers do not control the layout, or even the colors, of the elements. Vendors implement the look-and-feel as they like. But where Java ME is supported, there you will find Lists, Forms and Dialogs.
A good approach is to have only two Commands per screen. One of type OK (positive answer) and the other of type Cancel (negative answer). As manufactures do not mix these concepts you will end up having one command on each softkey.
Another benefit to use LCDUI is that it does not add to the application size.

Monday, September 29, 2008

Keep it flat

Jar files are Zip files with another extension and a special (and optional) folder named META-INF. For each file or folder there is a header associated. As headers take some space of the jar you better keep less files in it, but if you already took it to the bare minimum then keep all those files in the root directory.
For MIDlet distribution the jar file must have the META-INF folder so, for best space usage, your jar files should have only this folder. Your MIDlet and all other classes should be on default package. The same with resource files, keep all of them at file root.