Latest posts from Codename One.
Blog

Spatial, Pluggable SQLite
One of our enterprise accounts is working on a complex GIS application that needs fine grained control over mapping. In this case features such as native maps aren’t useful. For some GIS applications the old MapComponent is more useful as it allows working with domain specific data. One of the features he needed was spatial support in the builtin SQL database. When we initially implemented sqlite support we just delegated all the SQL calls to the OS native equivalents and called it a day. This works well for 98% of the cases but there are two big use cases that are missing by default in Android & iOS: Spatial queries & Security. ...

Facebook Clone Slow Landing
I mentioned before that I’m really behind on the Facebook Clone module but at least I was able to release the first few lessons by today which makes it fit into an April deadline. I’ll try to release new lessons every day so we can do have the full module out before the end of May. At that point I’ll release two new modules during June. The new Facebook Clone is similar to the Uber clone in some regards and also very different: ...

Version 4.1 and Launch Screen Storyboards
This weekend we pushed out an update that also included new versions of the GUI builder and the designer. We didn’t update the plugins but we still think it warrants the 4.1 version moniker even though we don’t support it in versioned builds. Due to one of the enhancements we added in this update we had a regression in command behavior that we fixed with an update within a few hours. ...
iOS Back Command Behavior and Facebook Clone Update
I’ve been working on the new Facebook clone app, I have a lot to say about that but I’ll defer that for now. One of the things that Facebook did is provide a different experience in iOS & Android. I wanted to replicate that by using a more iOS style back behavior in my clone. Figure 1. Back Command iOS/Android & Facebooks native on Android ...

Tutorial – DPI Explained
I’ve been working on improved learning materials for Codename One. One of the problems with videos is that I can sometimes unintentionally drag an idea that can be explained with a single image. DPI is one of those ideas, I’m assuming most of you already understand it but even if you do, I think this graphic helps put things in perspective. Figure 1. Device Density Explained in One Image 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. ...

Map Component Positioning Revisited
I published two articles on MapLayout here and here. After all that work they are now effectively obsolete thanks to a new API in MapContainer that builds component placement directly into the map itself. Unfortunately the Google API doesn’t let us position components (native or otherwise) accurately as it pans the map. This creates a small delay when panning/zooming as the components try to catch up to the map. The only workaround is to convert the components to images and ask the map to move images within it. Then convert the images back when the map finishes panning. That’s exactly what Steve implemented within the native maps. ...

Date Util
Timezones suck. Especially daylight saving. I don’t mind moving the clock or losing an hour of sleep as much as the programming bugs related to that practice. The thing that sucks even more is Java’s old date/time API. This was publicly acknowledged by the Java community with JSR 310 which replaced the Java Date & Time API’s however due to its complexity we still don’t have it yet. As a small workaround we created a small API to perform some common date calculations. ...

Build Native Interfaces – Camera Edition
I discussed the new Camera cn1lib last week. One of the motivations for doing it (besides the request from an enterprise account) was that of a new course module. Last week I added a new module covering the process of building the camera cn1lib… We have several online videos (both in the course and outside of it) covering native interfaces. So why do we need another one? Working with native code is error prone & complex. A lot of the tutorials we built in the past ended up spending more time on configuration issues than on code. In this module I talked a lot about Objective-C, callbacks, delegates & more. If you are thinking about native integration this helps give a more rounded view of the options. ...

TIP: IntelliJ/IDEA RAM
I’m used to NetBeans but if I will ever switch it will be to IntelliJ/IDEA. It’s a great IDE. I just need to rewire the muscle memory of my fingers for it. The Codename One plugin support on IntelliJ should be as good as the NetBeans support as the code is very similar. There are however a couple of pitfalls that a lot of people trip over which I’d like to discuss. ...

Camera Kit – Low Level Camera API
When we introduced support for z-ordering of peer components in Codename One we listed two major targets. The first was already available: Map. The second was still pending: Camera. Our current Capture API is very high level and removes a lot of the control from the developer. In order to give developers a high level of control we created Camera Kit. Camera Kit is based on a native Android Camera Kit project whose API we used to implement the Android port and for inspiration. This new API works on Android & iOS at this time. It allows you to grab photos/videos & view the camera preview like you would any other media. ...

Android Build Target 27 Migration
A while back Google announced that starting in August 2018 they will no longer accept applications targeting API levels below 26. With that in mind we plan to migrate our builds to use API level 27 which brings with it a lot of great new features but will probably break some things as we go through the migration. Please read this post carefully, I’ll try to cover everything. ...

TIP: Uninstall cn1lib
A while back a question was asked on stack overflow How do you uninstall an extension using the CodenameOne Settings tool in NetBeans? Unfortunately this isn’t automatic due to the way cn1libs are implemented. In some cases you need to uninstall a cn1lib if you no longer need its functionality and this is far from seamless. These are the steps you need to take: Remove the files with the name of the extension (the .cn1lib and the .ver file) from the lib directory – you can see them in the files tab in NetBeans or in the file explorer of your OS. ...