Latest posts from Codename One.
Blog

TIP: Obfuscation Mapping File
Proguard is one of the most disliked aspects of Android programming. Developers attack it left and right because there are so many nuances to it. That’s a huge mistake, proguard is one of the most important tools in our development toolchain. It makes our apps slightly more secure, much smaller and even slightly faster. Codename One apps use proguard by default for Android. This is a huge benefit in our case because the limits related to obfuscation are very similar to the limits related to portability. ...
Switch, Progress and Pull to Refresh
Some of our older components were developed years ago. As Android and iOS slowly converged their UI paradigms we got stuck supporting odd/outdated functionality as designs shifted. Three great examples are pull to refresh, OnOffSwitch and the InfiniteProgress features. OnOffSwitch contained labels both in iOS & Android. On Android it was literally a button that was moved back and forth. Today both OS’s use a simple switch graphic. When we developed the original component we didn’t have the same level of graphic drawing capability that we have today, that made the design of the iOS version even harder. ...

Build App Beta
One of the big “behind the scenes” motivations for our big build cloud migration was new server API’s. We now have a completely new backend and this made it easier to build a completely new Codename One App christened as “Codename One Build”. This app is currently in public beta on Android which you can opt-into here. Once we feel good with the Android version we’ll push out versions for iOS and maybe UWP if there’s demand for that. ...

TIP: Fix Issue with Missing Builds
A while back we announced the migration to the new build cloud. The migration worked very smoothly and mostly seamlessly but there was one caveat: client libraries must be up to date. This is a confusing point so hopefully this long overdue post will clarify it. The core of the problem is CodeNameOneBuildClient.jar. It’s a relatively simple jar with a few ant tasks that performs a lot of “under the hood” services such as sending the build to the cloud. It’s shipped within the IDE plugin and old versions of the IDE plugins would replace it automatically. We now update it via the update framework which is better but might cause a few issues. ...

Codename One 5.0 "Social" is now Live
We are thrilled to announce the release of Codename One 5.0 – Social. Codename One is an open source “Write Once Run Anywhere” mobile platform for Java and Kotlin developers! We postponed the release of this version since it’s so packed with big changes. We made CSS a first class citizen in Codename One and made CSS updates live (no recompile necessary). We moved from screenshots in iOS launches to storyboards. Added support for newer JDK’s. Migrated to Android API level 27. Moved our entire build server infrastructure. Redid push notification and so much more… ...

Codefreeze for Codename One 5.0 – Social
Codename One 5.0 (Social) will launch next week, to keep the code stable we are entering a week long code freeze. Please update your plugin installs frequently and report bugs immediately so we will have a stable release! We’ve added a lot of new features to 5.0 but a few of the big things are pretty disruptive: OpenJDK Support with JDK 9, 10 & 11 support XIB Build Mode ...

TIP: Auto Reconnect Web Socket
WebSockets changed the way I do networking code. I combine them with WebServices to get the best of both worlds. But they still suffer in terms of reliability. With WebServices we have retries and a mostly transactional model. There is no permanent connection that should be re-established. With WebSockets a disconnect can be painful, up until recently I used a rather elaborate strategy of error detection and timers. With the latest update to the WebSocket cn1lib we now have a better solution: autoReconnect(int). ...

Preparing for Codename One 5.0 – Social
Codename One 5.0 AKA Social will launch on September 19th. We pushed this release back to include support for crucial features such as JDK 11/OpenJDK support. With these features in place and a slew of other features we are gearing towards 5.0 GA. Tomorrow (Friday) we will push out plugin version 4.5 for all IDE’. This new version is effectively release candidate 1 for the 5.0 version. Normally we don’t bother with a release candidate this close to an actual release as the plugins don’t change much. However, we made some extensive changes to the plugins recently and we’d like to make sure we didn’t break too many things before the release. ...

Removing the Old Preferences
A while back we introduced Codename One Settings which superceded the old approach built in the IDE itself. This allowed us to consolidate code and move faster. That’s how we were able to implement more wizards for things like CSS support etc. Up until now we just left the old UI in place. People are still used to it. But it has a lot of bugs and causes confusion as developers launch the old UI instead of the new one. So with version 5.0 we’ll remove the old preferences UI and leave Codename One Settings. ...

TIP: Activate via URL and Send Arguments
The most secure password in the world is the one that doesn’t exist. You remove the user from the equation with a completely random key. To be fair this has some drawbacks and a password still exists somewhere (in your phone/email) but generally this works rather well… The trick is simple, if we want to authenticate a user we can email him a single use URL e.g. mycoolapp://act-32548b09-d328-4330-8243-d7d30c322e40. As you can see that’s pretty hard to guess or brute force. Once clicked the URL becomes invalid so even if it’s exposed somehow it would still be irrelevant. To do this we need two parts: ...

Status Monitor
I wrote before about Crisp and how pleased we are over the migration to their service. Recently they started offering a new service of status page. This service runs on their servers and essentially monitors whether our service is down. Due to the complexity of our service not all of the pieces are monitored but a few of the more important features are already mapped. Hopefully, if you experience service issues you can look in the status page and you’d know if something is going on. Notice that when it goes red we get alerts and notice that something is broken ...

No More iOS Screenshots
In February I wrote about a new/improved way to build for iOS without the screenshot process. That was a bit ahead of its time as the xib build didn’t disable the screenshot process yet. This is now fixed and it’s turned on by default now. That means that if you send an iOS build it won’t go through the screenshot generation process. This means that apps with native peers in the first screen such as maps, browser etc. will start working with this coming update. It also means the splash screen of the application on iOS will be relatively simple by default. You can customize it using xcode to make it more appealing. The upside is things such as multi-tasking etc. will work correctly. ...