Latest posts from Codename One.
Blog

Questions of the Week XII
June just ended and we are starting the final stretch to get 3.5 ready, there is a lot on our table right now so most of the work in the coming month will probably focus on stabilizing the GUI builder and fixing the remaining issues for 3.5. One thing we pushed to todays release in the last minute is a new API called: Toolbar.setCenteredDefault(boolean). This was triggered in part by a stackoverflow question below but is a recurring theme. The Toolbar used to center it’s title thru the alignment style, which is problematic as it isn’t centered relatively to the commands on the sides. We now center it properly but this might not be what you want so you can disable this functionality by calling Toolbar.setCenteredDefault(false);. ...

Charts Demo Revisited
The charts demo is one of the most elaborate/messy demos we have as it was derived/ported from an aChartEngine demo. Since the Codename One charts are themselves a derivative of aChartEngine this makes a lot of sense but the demo is a bit big and hard to follow. However, it does show off a lot of the chart types that can be created using the charts package. As such it is a very valuable demo… ...

ToastBar Messages
The ToastBar was one of those API’s I didn’t know I needed and yet I became addicted to it… Ever since Steve came out with the ToastBar I constantly catch myself typing Display.show only to delete that to use the ToastBar. It’s both really easy to use and more consistent with modern mobile UI design. As a replacement for Dialog it really needed the static “show methods”, so we added a simpler showErrorMessage which combined the ToastBar with the material font icons to create a proper error message. This allowed us to show an error message with a single line of code, but these things shouldn’t be used only for errors which is why we just added two new static methods: showMessage(String msg, char icon, int timeout) & showMessage(String msg, char icon). ...

Comparing PhoneGap/Cordova and Codename One
Last time around we compared Codename One to Xamarin and this time around I’d like to compare Codename One to what is probably the market leader: PhoneGap/Cordova. If Xamain is big then Cordova is huge, it is so prevalent that it is often the default assumption when people mention cross platform today. In fact, one of the big problems we had when describing Codename One was distinguishing it from HTML5 based solutions like Cordova. ...

Synchronous InfiniteContainer
InfiniteContainer and InfiniteScrollAdapter revolutionized the way we think about Codename One. Up until their introduction we advocated lists for large sets of components and this is no longer the case. However, InfiniteContainer has a controversial feature even within out team. It violates the EDT on purpose … InfiniteContainer allows you to “fetch” data dynamically into the container as the user scrolls down. The definition of “fetch” is problematic though. Up until now the fetch method was invoked in a separate thread. This was documented in the class but it is pretty problematic as the method returns an array of components. ...

Unleading & Mutating Accordion
We covered the new Accordion component last week and just started using it in a demo for which it was very suitable. As we were working with it we discovered that it was missing some core methods to remove an Accordion entry or change it’s title. But worse, was the fact that a delete button in the title wouldn’t work! The crux of the issue is in the fact that lead component doesn’t support excluding a specific component within the hierarchy from it’s behavior so we set about to fix that… ...

Questions of the Week XI
We just released an updated set of plugins with many bug fixes and enhancement mostly revolving around the new settings UI but also a lot of the functionality required for proper Windows UWP support… This has been a very busy week for us although most of the stuff we did was “under the hood” and not as visible as some of the previous weeks. We are also fast approaching the 3.5 release due this August so hopefully we can get our ducks in a row to create another compelling release. ...

Clock Demo
We’ve been working very hard on updating a very ambitious demo for this week but alas it still isn’t ready… In the meantime we decided to modernize the clock demo which is an important demo that is missing from the IDE’s for some reason which is a shame because it’s probably our only low level graphics focused demo… Check out a live preview of the demo on the right here thanks to our JavaScript port! ...
Parse Update, Faster Windows Desktop & UWP Guide
Historical note: Codename One’s UWP target was discontinued in release 7.0.229. This post is preserved for historical context only, and its build/setup instructions no longer apply to current Codename One projects. Chidiebere Okwudire of SMash ICT Solutions just released version 3.0 of the parse4cn1 library. The biggest feature of which is support for the open source Parse server which should work with some of the parse alternatives that popped up to fill the void left by Facebook. ...

Background Fetch
Background fetch allows an app to periodically “fetch” information from the network while the app is in the background. This is scheduled by the native platform, where apps that support background fetch will be started up (in the background), and their performBackgroundFetch method will be invoked. __ | Since the app will be launched directly to the background, you cannot assume that the start() method was invoked prior to the performBackgroundFetch call Implementing Background Fetch Apps that wish to implement background fetch must implement the BackgroundFetch interface in their main class. ...

iOS Migration Setback
A couple of weeks ago we detailed a plan to migrate to the new xcode 7.x build servers. We tried this migration over the weekend and while for most developers this worked rather nicely for some there were issues that we can’t explain so we decided to revert the change and regroup. We want this transition to be smoother than past transitions and since we aren’t currently working against a deadline we feel we have some time to refine this migration to a point where it will be seamless for all/most of our users. ...

Accordion Component
The Accordion ui pattern is a vertically stacked list of items. Each item can be opened/closed to reveal more content similarly to a Tree however unlike the Tree the Accordion is designed to include containers or arbitrary components rather than model based data. This makes the Accordion more convenient as a tool for folding/collapsing UI elements known in advance whereas a Tree makes more sense as a tool to map data e.g. filesystem structure, XML hierarchy etc. ...