Latest posts from Codename One.
Blog
StackOverflow, Cordova update, Validation, Text Input, Hints & Icon
After a discussion with some members of the community we decided to shift the weight of our support efforts to StackOverflow from our existing google group discussion forum. Notice that we will still answer questions in the discussion forum but we strongly prefer using StackOverflow (don’t forget to use the codenameone tag). There are issues with StackOverflow which is why we are keeping the existing group and will still answer questions/issues there but the benefits far outweigh the issues: ...

Sizing Images Just Right with Cloudinary
As I discussed in a previous article, creating a beautiful user interface that behaves appropriately across multiple devices can be a challenge, what with the vast array of screen sizes that your app may be deployed to. Codename One provides you with some power tools on this front. E.g.: Multi-images Pixel to Millimetre unit conversion (approximate) On-device image scaling In this article, I would like to share with you another powerful tool to add to your kit, the Cloudinary library. ...
Material Icons, Background Music, Geofencing & Gradle
We became infatuated with icon fonts a while back and used them quite a bit, recently we added the FontImage class that made them really easy to use. However, up until now you had to download a font. Look up the value and enter it in. This was OK but not ideal in terms of syntax/availability especially for simpler apps. Google’s material design includes a really cool mobile friendly icon font and using that for all our builtin features seems like a no-brainer. This reduces the total download size while making the fidelity of the UI much higher. As a result of this features like pull-to-refresh, infinite progress, share button etc. will implicitly look different and use the icon font. You can also use one of the huge list of Google’s material design fonts with just one line of code! ...

Should Oracle Spring Clean JavaFX?
If anything, they are rearranging the deck chairs on the Hindenburg! Stephen Colbert We really depend on JavaFX at Codename One, our simulator needs it. Our desktop build uses it and our designer tool is based on Swing. We want it to succeed, its important to our business! We are not alone, even if you are a Java EE developer and don’t care about desktop programming, keep in mind the fact that today’s desktop technology is tomorrow’s server technology. E.g.: C++ and Windows (a desktop technology) took the servers from Unix and C. Only to be replaced by Java (up until then a web based Applet language) and Linux. JavaScript might not look as a JavaEE contender today but as more developers come out of college liking JavaScript and not Java this will affect us all. ...

Migration To The New Push Servers Completed
Today we dealt with some push messages overloading our servers, some of the apps developed in Codename One are remarkably successful and as a result our push servers got bogged down. To mitigate that and prevent service interruptions we moved all push activity to the new servers, this effectively means that a push operation on the old servers will map to the new servers seamlessly. This also means that we no longer support the null push target even for the old push servers. Its just too expensive to support on scale of 150M+ devices. ...

Good Looking By Default, Native Fonts, Simulator Detection & More
I’ve spent a lot of time working with and reviewing other cross platform tools this past month, mostly with Cordova due to our recent announcement that we support Cordova. I hope it doesn’t come off as too arrogant but our “onboarding” experience is pretty amazing in comparison to pretty much everything else. Just install IDE, type in Codename One and follow wizard for new app. The only tools that are simpler than that are the rather limited web based solutions. But we do fall short in one major way, our “hello world” apps look bad by default when compared to pretty much any tool out there. There are a lot of reasons for this but none of them are good reasons and this gives a horrible first impression to any developer picking up Codename One for the first time. ...

PhoneGap/Cordova Compatibility For Codename One
We just released the first version of the open source CN1Cordova project on github. This means you can take a common Cordova/PhoneGap app, import it into NetBeans and build a native app using our cloud build servers without any changes! Before we delve into the exact process of converting an app lets start by reviewing the exact benefits PhoneGap/Cordova developers can gain from Codename One. You can also check out the video tutorial and slides below. ...

Hiding, URL Security & Advocacy
A common trick for animating Components in Codename One is to set their preferred size to 0 and then invoke animateLayout() thus triggering an animation to hide said component. There are several issues with this trick but one of the biggest ones is the fact that setPreferredSize has been deprecated for quite a while. We recently added a setHidden/isHidden method pair that effectively encapsulates this functionality and a bit more. This shouldn’t be confused with setVisible/isVisible that just toggle the visibility of the component. One of the issues setHidden tries to solve is the fact that preferred size doesn’t include the margin in the total and thus a component might still occupy space despite being hidden. To solve this the margin is set to 0 when hiding and restored to its original value when showing the component again by resetting the UIID (which resets all style modifications). This functionality might be undesired which is why we have a version of the setHidden method that accepts a boolean flag indicating whether the margin/UIID should be manipulated. You can effectively hide/show a component without deprecated code using something like this: ...

Properties & Continued Terseness
We’ve been working on some pretty exciting things recently trying to get them out of the door. As part of that work we added some API’s specifically one that probably should have been a part of Codename One 1.0: Properties file support… Working with properties files under Codename One should be identical to working with them under standard Java only instead of using java.util.Properties we need to use com.codename1.io.Properties. This allows the implementation to be updated more easily and more consistent across platforms. We also fixed some minor historic behaviors in properties e.g. making it derive from HashMap<String, String> instead of Hashtable which makes it both faster and removes the need for casts when working with it! ...

Java is Superior To React Native In Practically Every Way
I got into a discussion with a colleague on the Java vs. JavaScript subject, which is a problematic subject to begin with. He then mentioned how great React Native is, I decided I have to look into it and maybe grab some ideas for Codename One. There are some nice ideas there, but none of them is revolutionary or exceptional and most of them are pretty old news for Codename One developers running in Java 8. ...

Codename One 3.2 Now Live
We are thrilled to announce the immediate availability of Codename One 3.2! Version 3.2 sets the pace for many upcoming features & migration processes such as the new cloud infrastructure for push servers, modernized GUI builder etc. Codename One 3.3 is currently scheduled for January 27th 2016 and should continue the trend of iterative changes that form a larger platform evolution arch. Highlights Of The Release – Click For Details ____New GUI Builder (technology preview) ...

Terse Syntax, Migration Wizard & more
In this last minute before 3.2 finally comes out we have a batch of new features & updates. Some of the last minute features that went into Codename One include: shorter more terse syntax for creating forms, migration wizard for the new GUI builder & dialog adaptive sizing. Better Syntax For Populating Containers and Toogle Buttons Codename One is slightly verbose. In part its due to Java’s tradition of verbosity but some of that comes from the fact that we never considered terse to be a virtue. Obviously a lot of developers disagree with that notion and would like shorter syntax, which does have a point… One such small modification of the “why didn’t we do this sooner” variety is new methods we added to container that are shorter (add instead of addComponent) but also return the Container instance thus allowing chaining. E.g. this is taken directly from the KitchenSink’s input demo: ...