Latest posts from Codename One.
Blog

Always on Top and Style Parser
It’s been a busy week with 3.7.3 released and a lot of new things. Diamond made several PR’s over the past couple of weeks but one interesting PR is an “always on top” feature for the simulator which is exactly what it sounds… This is very useful for me personally as it will allow me to film coding while showing the simulator floating on top (thanks Diamond!) but it should be super useful for everyone. You can inspect the code/debugging values while the simulator floats on top. You can activate it using the simulator menu option. ...

TIP: Intercept Incoming SMS on Android
Last week I talked about using SMS to activate your application which is a pretty powerful way to verify a user account. I left a couple of things out though. One of those things is the ability to grab the incoming SMS automatically. This is only possible on Android but it’s pretty cool for the users as it saves on the pain of typing the activation text. Broadcast Receiver In order to grab an incoming SMS we need a broadcast receiver which is a standalone Android class that receives a specific event type. This is often confusing to developers who sometimes derive the impl class from broadcast receiver… That’s a mistake… ...

Tutorial – Crash Protection
Continuing the trend I revisited the old crash protection video in the “how do I” section and updated it with current information and details. The old video still featured an old flag that should be avoided… The new video is relatively short and simple as the feature isn’t very complex, I hope to produce several more of these and bolster the video section further. On a different subject I also neglected to mention the new security related module in the Codename One Academy courses. I’ll drop additional videos there later in the month. 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. ...
Pixel Perfect – On Top Menu
I already have half a post on text components but I’ve put that on hold for now as I’ve been working on the on-top side menu to supersede the existing side menu bar implementation. I’ve made some fixes for it over the week, I wanted to make it the default for Codename One apps but it still isn’t “perfect”. We will make it the default within the next couple of weeks so please test it after this weeks update and let us know ASAP if you spot any issues! ...

TIP: Send Device Activation SMS via Twilio
A very common question we get from developers is “how do I get the devices phone number”. The answer is “you can’t really and you shouldn’t”. To clarify, this is possible on Android but would require a scary set of permissions. It’s blocked on iOS completely though so you’d need a different solution anyway… If you look at apps like Uber, whatsapp etc. they all use SMS activation. They just ask you to type your number and activate your phone via SMS. Usually this SMS is sent from the server side but for simplicity lets discuss how this can be done entirely from your app. ...

Tutorial – Include Source
I redid the include source tutorial which was really old by now and included some outdated “facts” while missing key information. Include source allows us to get the native OS project source code on build, this allows us to debug and profile on the devices. New Codename One users often mix up native interfaces and include source. You shouldn’t change the code generated with “include source”. It’s for debugging purposes only. If you need to write native code just use native interfaces to do so, you can then use include source and the native debugger to debug your native interfaces. ...

TIP: Outsource App Translations
A common trick for gaining traction is localization to multiple languages, Codename One makes that very simple as we explained here. However, unless you are fluent in multiple languages you will need some help to localize broadly. There are multiple paid services that address this need. There are a couple of pitfalls you can fall into when using such services. The first pitfall is trying to get them to work with Codename One, most such services wouldn’t be familiar with Codename One. We support an export feature in the Codename One designer: ...

New Features and Pull Requests
I haven’t blogged as much in the past month and as a result I have a big pile of updates from all over. This is going to be a big list so I’ll start with a few pull requests that were submitted by Diamond and Durank. If you see something broken or something that could be better in Codename One just fix it like they did! New Material Icons & Multi Selection Calendar In this pull request Diamond added two separate features: ...

Make it Look Like the Design
The Michael Jackson documentary, “This is It”, included a behind-the-scenes look at Michael Jackson’s preparation for his final tour, that tragically would never happen. In one scene, he has an exchange with the keyboard player that goes roughly as follows: Michael Jackson (to keyboard player) : That isn’t right Keyboard player : How do you want it? I can do it anyway you want it. Michael Jackson : Just make it sound like on my CD. ...

VM Changes and Updates
The summer is finally coming to an end but we might not get to full speed before mid September. Thankfully this didn’t impact Steve who did some pretty great things this August including a lot of GUI builder fixes/enhancements that we’ll cover with the next plugin update. But what we will have this weekend is pretty spectacular. As a short PSA: we’re pushing out the weekend release right now because I’ll be traveling tomorrow. So all this should be available today. ...

Millimeter Underline
I’ve been working on the new pixel perfect post which I would like to focus around the text components, in order to do that I needed an underline border type. Historically this is something we shrugged off and pointed people at the 9-piece border. That was the wrong answer and it partially related to the way rendering used to work in Codename One and partially related to our reluctance in changing the resource file format. ...

Sortable Table
Sometimes I get a question on stack overflow that triggers a “yes this should be easy” reflex. I got such a question a couple of weeks ago when I implemented the animated gif support cn1lib and I had another one last week which asked about sorting tables. This is actually pretty easy to do but it’s just something we didn’t get around to. So I just implemented it and decided this would make a lot of sense in the core API. Sortable tables make a lot of sense and ideally should be the default. ...