Fork us on GitHub

Flat Themes, DPI's & Static Initializers

Features that slipped under the radar for 3.0
Flat Themes, DPI's & Static Initializers

Flat Themes, DPI's & Static Initializers

With the release of 3.0 we were overwhelmed with a lot of last minute features and improvements. It seems that we neglected to mention a lot of features that made it into the final 3.0 product.
One of the nicest new features is a set of new flat themes with various colors in the designer and the project wizard. We found that a lot of developers prefer themes with more control over the look, themes that look more similar across platform yet have a more modern "flat" feel.

A long time request has been to add the additional DPI resolutions we added for higher density devices into the designer tool. We now support these additional densities in the designer tool both in the multi image import and when editing a specific resolution.

On a different subject, we noticed a couple of developers had one of those hard to track down bugs that boiled down to using the FileSystemStorage API from static context. E.g. this:

public static final String MY_HOME_DIR = FileSystemStorage.getInstance().getAppHomePath();

This seems like code that should work and annoyingly enough it works on the simulator. However, because of the way classloaders work this code will probably fail on devices. Static context can be initialized at any time and since the initialization of the implementation code might occur after the initialization of static context the static variable might not work well...
You should pay attention to such code where you invoke implementation classes from static context and try to avoid it, ideally we'd make this fail on the simulator but that is a bit tricky.

Share this Post:

Posted by Shai Almog

Shai is the co-founder of Codename One. He's been a professional programmer for over 25 years. During that time he has worked with dozens of companies including Sun Microsystems.
For more follow Shai on Twitter & github.