Latest posts from Codename One.
Blog
Pixel Perfect – Text Input (Part 2)
Last week we discussed the first part of working with text components and left some big tasks for this week. This week we’ll try to address the remaining issues with text input and make it easier to construct UI’s. This is crucial as we’ll be going into code freeze soon and we need enough time to iron out the issues in the text input. Last week I ended the post with this set of tasks: ...

New Milestones and Features
We will enter code freeze for Codename One 3.8 next week and have a lot of things to clear off the table in order to get there! The first order of business is that there will be no Codename One 3.9… Instead we will go right to 4.0 and switch to major version number update scheme only. This will align us better with industry standards. We spent ages in 3.x and far less in 1.x or 2.x numbering. That doesn’t make sense. It’s hard to tell what feature is big enough for a “major version number update” and it doesn’t indicate as much with the fast pace of releases. So switching to major version numbers in terms of milestones will simplify and give a better indication of the work we put in. ...

Tutorial – Creating Lists
Some of our how do I videos are so old it’s embarrassing… This is especially true for some core concepts videos as they were some of the first ones we made. The worst part is that these are probably the most important videos we have as they are viewed by developers completely new to Codename One. We had two videos covering creations of lists and both of them used com.codename1.ui.List with the old GUI builder! ...
Pixel Perfect – Text Input
I started working on this post back in August and so much happened in between I just had to scrap the whole thing and start over again… I’ve discussed buttons before and now it’s time for TextField & TextArea. But before we go into that lets take a moment to talk about the problems that arose from the last installment of pixel perfect. I made a lot of changes to Codename One but there was one particularly painful change: caps text. This proved to be a far more controversial change than I had intended and I had an interesting debate with Nick. I’d appreciate participation in the thread there or here. The gist of the debate is how can we change functionality people rely on without disrupting working code. I honestly didn’t think the caps text change was a big change or would cause the problems it did. However, having said that it’s really hard to rollout a feature without disrupting developers occasionally. ...

TIP: Map Layout Manager
__ The information in this blog post is slighly out of date. Check out the newer blog post that covers positioning components on the map. I’ve recently added a segment to the online course covering the native maps. This segment is a part of a larger trend towards the upcoming Uber demo which we will release before the end of the year. As part of that work I did some initial “half baked” work on a map layout manager. ...

Tutorial – Background, Images, Borders and Gradients
Backgrounds include a lot of nuance, especially the part covering the priorities which I start with in the tutorial below. Because of that this is one of the longer how do I videos I’ve done in a while as there is just so much to cover. I still had to cut a lot of stuff away and focus almost entirely on the designer tool. Styling in code isn’t covered at all in the video. I think most developers who would prefer hand coding would probably feel more comfortable learning from the developer guide which covers all of that already. I also didn’t cover the CSS support although there is some discussion of that in the academy. ...

Don't Touch That Code
Last week scrolling broke and we had a few relatively complex regressions. This can be traced back to a change we did to the getComponentAt(x, y) method, this change in itself fixed a problematic bug but triggered far worse bugs and we just had to revert the whole thing… So why did we even do a change to a method that’s so deep in the code and so risky? ...

TIP: Use Weak References
One of the less familiar features of Java is the mess of weak/soft/phantom references. This is a confusing mess and it’s compounded by the fact that other languages (such as the reference counting Swift/Objective-C) have used these terms with a different meaning. To simplify this weak references in a garbage collected language allows you to keep a pointer (reference) to an object that won’t force it to stay in RAM. ...

Tutorial – Versioned Builds/Repeatable Builds
Versioned builds are one of the more confusing features of Codename One mostly because the word “version” is so overloaded with meaning. The feature itself is remarkably simple as explained in this video tutorial. Versioned builds allow you to build against a fixed point release version of Codename One, that means that if we break something in the build servers you can still work against the last major version that we released. ...

Media Controls and Print Developer Guide
I did a lot of work on the developer guide PDF making it more suitable to print, as part of this work I submitted the guide to Amazons KDP which means you can now order a physical book of the developer guide. I reduced the page count significantly for lower cost and image size requirements. As a result the book is much smaller but contains the exact same information in a denser package. ...

TIP: Using Lombok and Other tools
A few weeks back maaartinus asked on stack overflow whether we can get lombok working with Codename One. After a short back and forth it seems that this was as easy as I’d hoped and he was able to get it working without a change. Personally, I like our approach of property objects more but that’s obviously a matter of taste. Lombok works by processing the bytecode after compilation to convert annotations to terse code. E.g. this Java code using Lombok: ...

Tutorial – Desktop and JavaScript Ports
Codename One has ports for Mac, Windows & even for the browser. These are often confused and the introduction of the UWP port which also includes some overlap only made matters worse. Each one of these ports covers a segment that the other ports don’t. In this tutorial I try to separate the various ports & explain when each one of them should be used. I also dispel common misconceptions about these ports. Archived Comments This post was automatically migrated from the legacy Codename One blog. The original comments are preserved below for historical context. New discussion happens in the Discussion section. ...