Latest posts from Codename One.
Blog

Tutorial: Networking and Webservices
Networking in Codename One includes so many different options and some very complex capabilities. This tutorial doesn’t cover all the options but it tries to clarify the logic of why we have both URL and ConnectionRequest. It also explains the socket API types and which one makes sense in which situation. We also provide a couple of simple examples of REST API calls and an overview of the different ways in which REST can be implemented. ...

Restaurant App Builder
In the bootcamp we didn’t build just one big app, we built two… Or infinity… The first app was a restaurant ordering system that allows you to pick dishes from a menu and add them to a shopping cart. The second app was an “app builder” that allows you to customize the first app and then generate a native app based on that for your specific restaurant. I kept that under wraps because I wanted to do a big “launch” and release the app to the wild based on that but I ended up being so busy after the bootcamp completed that this just didn’t materialize. So instead of doing a big launch I’m doing the softest possible launch for this app. This is how the restaurant app looks, I cover its creation in the upcoming courses too: ...

TIP: Don't Put Text Fields in Dialogs
Text input is a very special case. Besides mixing the native and Java code we also need to deal with the appearance of the virtual keyboard which doesn’t act consistently across platforms. This creates many complex edge cases that are just as problematic on native OS platforms as they are in Codename One. When we show a virtual keyboard there are two main scenarios that can take place: ...

Kotlin WORA for iOS (iPhone), Windows & Android
We received some interest related to Kotlin over the past couple of years and this has risen noticeably in the past month or so. Up until now we tried to be very focused on Java which is why we didn’t add support to other JVM languages even though this shouldn’t be too hard. But Kotlins similarity to Java and its special relationship to Android make it an ideal second language for us. ...

Tutorial: Storage, File System and SQL
Storage is one of the big subjects we can delve into and never come out. Even without going into offshoots such as parsing, networking etc. it’s still a pretty huge subject. We tried to simplify a lot of these problems by splitting file system from storage in Codename One but this often caused a different type of confusion. Because I tried to keep the video very simple I also didn’t get into too many samples or variations e.g. no externalization or other interesting discussions. I specifically avoided those as with properties this becomes far easier but I also think these might make the video harder/longer. ...

New Online Courses – Coming Soon
You might have noticed that I haven’t been committing as much code recently. It’s because I’ve been working on 3 new online Codename One courses. One of my main goals with the bootcamp was to improve my video skills and modernize course materials. I’m well on my way with both and created pretty exhaustive materials so far. Since these courses require a lot of work it’s hard to provide a set date for their release but I hope I’ll be able to publish at least the first two soon… Currently the plan is to release an introductory course, an advanced course & a professional app building course. ...

Clearable Text Field
A common request over the past couple of years has been to add a text field that supports a clear button in the end, we used to have a common answer on how this can be implemented but we didn’t have an actual implementation builtin despite this being a relatively common request. At first I thought this is something we should implement natively but it turns out that this doesn’t exist natively in Android so we just implemented this as a wrapper to the TextField e.g. replace this: ...

TIP: Don't Ask Again
One of my favorite things about Mac OS is something subtle that took me a while to notice: it doesn’t ask stupid questions. If you delete a file on a Mac it goes to the trashcan immediately, no question. Even though other OS’s copied the trashcan concept they didn’t embrace it in the same way, most of them still ask whether you are sure about this action even though the action is reversible. ...

Tutorial – Properties
I’ve discussed properties a couple of times before but never in a condensed video tutorial like the one we have here. In this video we review the value proposition behind properties as a step by step process. I hope to create more elaborate properties demos that would show off the full capabilities of this API. Discussion Join the conversation via GitHub Discussions.

Flamingo SVG Transcoder
SVG (Scalable Vector Graphics) is an XML based image format that represents an image as vectors instead of pixels (raster). An SVG file is represented by the set of lines & shapes that make it and can thus be rendered at any resolution without quality degradation due to scaling. It has some other neat tricks up its sleeve but I’m only going to discuss that specific feature today. ...

Static Global Context
A developer recently asked me why Display is called Display when it has such a broad purpose? The reason is historic with roots in Codename One’s origin back in 2007, when we formed the company Chen advocated for a rename of that class and I disagreed. In retrospect I was wrong, the name doesn’t work. This isn’t something we can easily fix but it’s something we can replace and improve… ...

TIP: Understand Image Masking Performance
Image masking allows us to adapt an image which we acquired from an external source to fit our design e.g. if we want to show an image cropped to a circle we could apply a mask to it in order to get an intelligent crop. This is a very powerful tool as a designer can supply a hardcoded mask image and build some pretty complex shapes that include an alpha channel as well (making it superior to shape clipping). ...