Latest posts from Codename One.
Blog

Codename One 3.6 Release Plan
We will release Codename One 3.6 on the 16th of January, this means we will enter code freeze on the 9th during which only critical bugs will be fixed with peer review. Since Codename One is a SaaS product release cycles aren’t as crucial for most of us but they provide a framework both for versioned builds and for us to focus on the more mundane aspects of product maintenence. ...

Auto-Renewing Subscriptions in iOS and Android
__ This is the third post in a three-part series on In-App purchase. Please check out Part I: Introduction to In-App Purchase and Part 2: Implementing Non-Renewable Subscriptions. Auto-renewable subscriptions provide, arguably, an easier path to recurring revenue than non-renewable subscriptions because all of the subscription stuff is handled by the app store. You defer almost entirely to the app store (iTunes for iOS, and Play for Android) for billing and management. ...

TIP: Setup a Codename One Project from Git
Opening a demo or sample code from GIT is relatively easy if you are an experienced Codename One developer but for a lot of newer developers for whom samples are often more crucial this can be challenging. One of our solutions was placing the demos in the Codename One new project menu but that’s probably not enough. First before we begin with the step by step guide let’s explain what is happening… ...

Preferences, Location, Popup & Order
One of the fallouts from the new encrypted storage API we added last week is the fact that it encrypts things like preferences making them unusable if you expected them to work before/after encryption was applied. To workaround this we added a new API to the Preferences class: public static void setPreferencesLocation(String storageFileName) public static String getPreferencesLocation() These API’s allow us to determine the storage file in which the preferences are stored (not to be confused with FileSystemStorage file). By default preferences are stored in CN1Preferences but you can use any file name you want. This is useful if your app allows several logins and you might want to use preferences differently for every login. ...

Blog Vacation
Happy holidays, Merry Christmas, happy new year to all. All of us here at Codename One hope you have a lovely vacation if you are taking one. Since half of our readership is from countries that celebrate these holidays it seems like a good time to take a short blogging vacation as well. We’re still working here and will make releases/offer support as usual but we’ll update you on the changes we had in our 2017 posts. We’ll be back to blogging on January 2nd. ...

Implementing Non-Renewable Subscriptions with In-App Purchase
__ This is the second post in a three-part series on In-App purchase. Please check out Part I: Introduction to In-App Purchase and Part 3: Auto-renewing Subscriptions in iOS and Android. In my last post we looked at one-off in-app purchases. In this post we’ll look at subscriptions. As we discussed before, there are two types of subscriptions: Non-renewable Auto-renewable Non-renewable subscriptions are really the same as consumable products, except that they are shareable across all of a user’s devices. Auto-renewable subscriptions, on the other hand, will continue as long as the user doesn’t cancel it. They will be re-billed automatically by the appropriate app-store when the chosen period expires, and all management of the subscription is handled by the the app-store itself. ...

TIP: Table to Box
One of the most painful aspects in any mobile app is input, besides the difficulty of viewing the details on a tiny cramped screen the input via the virtual keyboard is nowhere near the input comfort of a full fledged computer or even a tablet. A great app adapts to the screen size and uses the available space more effectively, we tried to do this in the kitchen sink demo where user input appears like this in portrait: ...

Questions of the Week 36
We had to push out an update to the IntelliJ/IDEA plugin to workaround an issue that started happening with their latest IDE update. The 3.5.11 version didn’t change much just fixed those specific issues. Other than that this weeks release includes some new In-App-Purchase features (that we will discuss next week) and the new seamless caching API discussed yesterday. One of the features we didn’t mention this week in the posts is a new ability to set the default size of a floating action button using code like: ...

Automatic Caching
Caching server data locally is a huge part of the advantage a native app has over a web app. Normally this is non-trivial as it requires a delicate balance especially if you want to test the server resource for changes. HTTP provides two ways to do that the ETag and Last-Modified. While both are great they are non-trivial to use and by no definition seamless. We just added an experimental feature to connection request that allows you to set the caching mode to one of 4 states either globally or per connection request: ...

Introduction to In-App Purchase
__ This is the first post in a three-part series on In-App purchase. Please check out Part 2: Introduction to In-App Purchase and Part 3: Auto-renewing Subscriptions in iOS and Android. In-app purchase is a helpful tool for making app development profitable. Codename One has supported in-app purchases of consumable and non-consumable products on Android and iOS for some time now, and with the next update we are adding support for subscriptions. For such a seemingly simple task, in-app purchase involves a lot of moving parts – especially when it comes to subscriptions. For this reason, I’ll be splitting this topic up into a few different blog posts. This post will provide a light introduction to in-app purchase and subscriptions, and show you how to support them in your app. In subsequent posts, I’ll go deeper into some more advanced topics such as receipt validation, server-side subscription management (which is required for subscriptions in the iTunes store), and the specifics of how to set up in-app purchases in both Google Play and the iTunes stores. ...

Cache, Sorted Properties and Preference Listener
We’ve had quite a few interesting features land last week and didn’t get a chance to cover them. First we have access to the OS’s caches directory where you can store files that you don’t really need as cache. Both iOS & Android have such a directory and files stored there might be purged without notice if the OS runs out of space. This is a good place to store files you don’t really need such as images or downloads you just need for “right now”. ...

TIP: Search the Website
A frequent complaint we get is the lack of a search feature on the site and we get that. It’s frustrating to us too. We’d like to add it but are still looking at the “right way” to do it which I’ll discuss at more length below but for now I’d like to discuss a couple of relatively simple workarounds. The Current Workarounds Google Site Search We can just type site:codenameone.com followed by your query into google when searching to search within the site e.g. like this https://www.google.co.il/search?q=site%3Acodenameone.com+Button ...