Post Image

Tutorials & Resources - Learn Java on Mobile videos courses for iOS, Android etc.

There are many Codename One resources for building native mobile apps but they are often all over the place, in this blog post I'll try to concentrate the best resources for people who already know Java and are looking to pick up Codename One. If you don't know Java yet please check out this post where we discuss resources for beginners to Java.

Read More
Post Image

Deploy the Same Mobile App/Template Multiple Times

We often build one app and sell it to multiple customers. After all, most customers ask for similar things with minor changes. E.g. if I build a restaurant app and then sell it to one establishment I can then resell it to another with almost no change at all...

Read More
Post Image

Codapps.io is back Java on Mobile from Scratch

We've discussed codapps.io before, it's a MOOC (online course) that allows you to learn Java programming and uses mobile/Codename One as its vehicle. Our current documentation and tutorials can be quite intimidating to a person who is a complete Java newbie so this course is quite helpful in bridging that gap.

Read More
Post Image

KitchenSink II

I try all things, I achieve what I can.
Opening with a Moby-Dick quote seems rather appropriate for taking on the kitchen sink demo. It often seemed like a task that is too big and unsurmountable as we were working our way thru it. In fact the version that we are releasing now has far less features and abilities than our original whiteboard...

Read More
Post Image

Using Icon Fonts Such as Fontello

A lot of our focus in the past couple of releases has been around the material design icon fonts, they changed the way we build UIs. We also support arbitrary font icons, this features isn't limited to material icons and we blogged about it a while back.

Read More
Post Image

Avoiding Lists

When picking up a new UI API people often start with a list of items. Lists are often used for navigation, logic and data so it's a natural place to start. Codename One's List class is a bad place to start though... It's complex and encumbered and has far better alternatives.

Read More
Post Image

Image Overriding

I hoped todays post would cover the new Kitchen Sink demo but due to a couple of bugs we decided to postpone that to next week. In the meantime I'd like to discuss something I did there which is actually pretty cool and most developers have no idea that we can do Image Overriding.

Read More
Post Image

Dynamic AutoComplete

With the fix for issue #1694 we can now have a moderately simple method of creating an AutoCompleteTextField that works with a webservice. This has been requested quite often and was quite frustrating to implement in the past it is now relatively simple with just a few lines of code.

Read More
Post Image

How to Build a Clicking (Tapping) Game Tutorial

Over the weekend LokeHansen posted a new series of youtube videos covering the process of creating a game in Codename One. I really enjoyed watching them as his teaching style is far more accessible than mine (I tend to be overly technical without noticing).

Read More
Post Image

Using the new GUI Builder

We had a couple of posts in the past about the new GUI builder but we didn't have a "how to" guide yet. In this post we'll try to go step by step over the process of using the GUI builder and understanding its inner workings. We'll also try to clarify conclusively the role the new GUI builder plays in the toolchain and the migrations process from the old GUI builder.

Read More
Post Image

Charts Demo Revisited

The charts demo is one of the most elaborate/messy demos we have as it was derived/ported from an aChartEngine demo. Since the Codename One charts are themselves a derivative of aChartEngine this makes a lot of sense but the demo is a bit big and hard to follow.

Read More
Post Image

Clock Demo

We've been working very hard on updating a very ambitious demo for this week but alas it still isn't ready... In the meantime we decided to modernize the clock demo which is an important demo that is missing from the IDE's for some reason which is a shame because it's probably our only low level graphics focused demo...

Read More
Post Image

Social Boo Revisited

SocialBoo originated from the same app design vault set of designs that brought us the Chrome Demo. This demo uses a somewhat outdated but still reasonable gunmetal look, it also features different UI styles when running on a tablet/phone. Notice in the screenshot above that the UI for the demo differs when running in a phone/tablet and even changes when the tablet flips between portrait and landscape...

Read More
Post Image

Dr. Sbaitso Revisited

Dr. Sbaitso is one of our newer demos. We wrote it for a workshop at JavaZone a couple of years ago and it proved to be an excellent tutorial on many complex abilities of Codename One. It captures images from the camera, rounds them, does dynamic search with a chat like bubble interface...

Read More
Post Image

Debug a Codename One app on an Android Device

Debugging Codename One apps on iOS devices has been documented well with a video for years, we didn't spend too much time outlining the Android counterpart mostly because we didn't really use it as much and it was far simpler.

Read More
Post Image

Property Cross Revisited

PropertyCross is one of our newer demos, due to that there was relatively very little work needed to modernize it and this resulted in a stunning improvement over the existing demo. During that process we also discovered a small regression due to changed in the web service we relied on.

Read More
Post Image

Toolbar Back & Easier Material Icons

When we initially launched Codename One it was pretty hard to imagine todays apps. Menus and back navigation were miles apart when comparing Android 2.x and iOS 4.x... So we created a very elaborate set of abstractions (command behavior) that served as a set of patch framework we could live with for a while.

Read More
Post Image

Chrome Demo

This week we chose to modernize the very outdated Chrome Demo. This demo is one of our early demos developed during the iOS 4.x era. We licensed it's original design fromapp design vault and created a Codename One version of that original template. While the guys in app design vault modernized most of their templates to iOS 7 flat design they didn't do this for the Chrome demo.

Read More
Post Image

Camera Demo

With the 3.4 release we discussed the process of modernizing the demos and the first one we picked for this task is the camera demo which is probably the easiest one of all the demos...
The demo is trivial and doesn't really demonstrate anything other than capturing and showing an image captured from the camera/retrieved from the gallery but this is where it gets interesting. It even works in the JavaScript port so you can even run this in the browser and it works as you'd expect!

Read More
Post Image

Java 8 Switch, New Preferences & Demo Structure

With the 3.4 release we discussed the process of modernizing the demos and also mention that we would continue the trend of building Codename One on top of itself. We now have a rough outline of what we are going to do possibly starting with the next plugin update.

Read More
Post Image

New Getting Started Video - Eclipse Version

We finally uploaded the last of the 3 hello world videos covering Eclipse, which now joins the ranks of the NetBeans and IntelliJ/IDEA videos.
Check out the Eclipse version here...

Read More
Post Image

New Getting Started Video - IntelliJ/IDEA Version

As I mentioned last week we are redoing a lot of our videos and this video will serve as a benchmark to where we want to be in terms of production. We just released a modified version of the video geared towards IntelliJ/IDEA users here. We are really excited about the new IntelliJ/IDEA plugin we released a couple of weeks ago and this video shows off some of it's capabilities.

Read More
Post Image

New Getting Started Video

We just published a new introduction to Codename One video, that we hope will set the bar for future videos from us (or at lease set the bar for the more important videos). This initial one is focused on NetBeans but we intend to publish similar videos for IntelliJ/Eclipse shortly. You can check out this video in the How Do I section right here.

Read More
Post Image

PSD to App Revisited

One of our most important posts from 2015 was Steves PSD to App: Converting a Beautiful Design into a Native Mobile App. This post included a very thorough step by step video guide walking thru the creation of a non-trivial UI design and ended with the introduction of Steve's CSS plugin for Codename One.

As we are close to wrapping up the developer guide update it occurred to us that this remarkably important tutorial isn't within the developer guide!

Read More
Post Image

SQL Explorer, Global Toolbar, Location & Docs

I was working on documenting the SQLite support in Codename One, you can see some of that work both in the db package and in the developer guide. As a demo for SQL I decided to just create a tool that allows you to type arbitrary SQL to execute it on the device and see the results in a Table...

Beside being a cool example this can be a hugely powerful debugging tool to one of the more painful API's to debug on the device. You can integrate this as a hidden feature into your application and use it to debug odd "on device" issues by querying the DB!

Read More
Post Image

It's Full Of Stars & Terse Commands

A very common UI pattern is the 5 star ranking system. Up until recently we always had the same answer when developers asked us how to implement it: "Use toggle buttons (CheckBox)".
This is still not a bad answer but we think there is a "better" simpler way to do this thru the Slider which was effectively designed with this usage in mind.

Read More
Post Image

ToastBar & Gaussian Blur

Just last week I wrote that we are making an effort not to add new features and we got foiled by a couple of new features. The main reason for this is paying customers who need to have a feature now. This makes it hard for us to focus completely, but it does keep the lights on here so we can't really complain.
To be fair, during this time we were able to almost double the page count of the developer guide from the 3.2 era to 576 pages at this moment and we still have a lot of work ahead of us in that department.

Read More
Post Image

Component & Layout Galleries

As you know we've been working a lot on the docs both the developer guide and the JavaDoc's, we nearly doubled the amount pages in the developer guide and we did it without "cheating" (e.g. cramming more stuff, increasing font size). You can see all that work in the developer guide section but what I want to discuss today is the new Component Gallery and Layout Gallery.

Read More
Post Image

Understanding The Table Component

Table is a composite component (but it isn't a lead component), this means it is a subclass of Container. It's effectively built from multiple components (but it isn't a lead component), this means it is a subclass of Container. It's effectively built from multiple components.

Read More
Post Image

JavaDoc Source Samples That Don't Suck

JavaDoc source code embeds suck!
I love JavaDoc but it didn't age well. When you work with other tools (e.g. in the Microsoft world) suddenly the embedded samples look amazing and "search" functionality is just built in!
Why can't we have that?
JDK 9 is introducing new support for search but source embeds can be so much better and are a crucial learning tool...

Read More
Post Image

How To Use The Codename One Sources

I've written open source software since the 90's both for my own projects and for Sun Microsystems. When we founded Codename One open source was the only option!
We didn't choose open source with the goal of receiving code contributions. Contributions are pretty rare even in highly visible projects. We saw the true benefits of open source for a project like Codename One: trust.

Read More
Post Image

Ratatouille's Restaurant In Code

One of my favorite Pixar movies is Ratatouille, maybe because I'm such a glutton. So when I was thinking about the next tutorial/demo and the idea of a restaurant app came up I knew it had to be based on Ratatouille. This is a relatively simple demo that can literally fit in a single blog post all the way thru and the real cool thing about it is that you can try the JavaScript version right now from your browser without compiling anything...

Read More
Post Image

Sizing Images Just Right with Cloudinary

Sizing images for multiple DPIs and device sizes is challenging. There are image quality and bandwidth considerations, especially when loading images over the network. The new Cloudinary cn1lib simplifies this process by preprocessing images on the server side, so that they can be delivered to the mobile app in the exact correct side and quality.

Read More
Post Image

PhoneGap/Cordova Compatibility For Codename One

We just released the first version of the open source CN1Cordova project on github. This means you can take a common Cordova/PhoneGap app, import it into NetBeans and build a native app using our cloud build servers without any changes!
Before we delve into the exact process of converting an app lets start by reviewing the exact benefits PhoneGap/Cordova developers can gain from Codename One. You can also check out the video tutorial and slides below.

Read More
Post Image

Hiding, URL Security & Advocacy

A common trick for animating Components in Codename One is to set their preferred size to 0 and then invoke animateLayout() thus triggering an animation to hide said component. There are several issues with this trick but one of the biggest ones is the fact that setPreferredSize has been deprecated for quite a while.

Read More
Post Image

I Am Your Density

This morning I was awoken by myself - or rather the 1985 version of myself. He (I'll refer to the 1985 version of myself in the 3rd person here forward) was in a panic and was yammering about something to do with changing history. He asked why my pants were inside out, and I wondered why he was wearing a life preserver. According to him, he had driven a time machine from 1985 to this day (October 21, 2015) in the future to stop me from making a terrible mistake. I asked him: "What mistake?", to which he produced a 3.5 inch floppy disk.

Read More
Post Image

Rounded Corners, Gradients, and Shadows with CSS

The new Codename One CSS library enables you to create entire themes using only CSS, but in this post, I’m going to focus on its ability to automatically generate image backgrounds and borders for your apps.

Read More
Post Image

Integrating 3rd Party Native SDKs Part III

This is the third and final instalment in a series on integrating 3rd party native SDKs in your Codename One application. If you missed the first two chapters, I recommend you begin with part one before reading this tutorial, as it provides much needed context for the procedures described here.

Read More
Post Image

Release Plan For 3.2 & New Approach To Demos

Codename One 3.2 is scheduled for Tuesday the 27th of October. In keeping with our successful 3.1 release we'll use a very short one week code freeze on the 20th of October at which point we will only commit crucial fixes with code review. I hope we can land quite a few new features for the release, the GUI builder is getting very close although its still a very rough product and will only be featured as a "technology preview" showing the direction we are heading rather than a final product.

Read More
Post Image

Integrating 3rd Party Native SDKs Part II

This blog post is part two in a three-part series on integrating 3rd party native SDKs into Codename One application. I recommend you start with part one in this series as it will give you much-needed context to understand the procedures described in part two and three.

Read More
Post Image

Local Notifications on iOS and Android

We are happy to announce support for local notifications on iOS and Android. Local notifications are similar to push notifications, except that they are initiated locally by the app, rather than remotely. They are useful for communicating information to the user while the app is running in the background, since they manifest themselves as pop-up notifications on supported devices.

Read More
Post Image

Integrating 3rd Party Native SDKs Part I

This past Thursday, we held our fourth webinar, and the topic was how to incorporate 3rd party native libraries into a Codename One app. I used the recently released FreshDesk cn1lib as a case study for this webinar. As the topic is a little involved, I decided to break it up into two webinars. In part one, we focused on the public API and architecture involved in developing a wrapper for a native SDK, and walked through the native implementation for Android.

Read More
Post Image

Updated Parse Lib, Tiling Performance, Decimals & Trees

The excellent Parse4cn1 library just announced version 1.1. The biggest new feature is batch operations but there are a few others that could be helpful. Overall the library was pretty solid before the 1.1 version and this is a nice improvement on top.

Read More
Post Image

Building A Chat App With Codename One Part 6

This will be the last installment of this tutorial which was pretty complete in the previous section already. We might have additional installments mostly for covering enhancements such as "invite a friend" and other similar capabilites but this is probably as good a place as any to finish the app and let you try it live.

Read More
Post Image

PSD to App: Converting a Beautiful Design into a Native Mobile App

Codename One provides extensive support for designing beautiful user interfaces, but it isn't necessarily obvious to new developers how to achieve their desired results. A common workflow for app design includes a PSD file with mock-ups of the UI, created by a professional designer.

Read More
Post Image

Building Cloud-powered Native Mobile Apps with Parse.com and Codename One

A couple of weeks ago I created a simple social network app as part of the Codename One webinar. This app provided functionality similar to the Facebook app.

Read More
Post Image

New Push Servers

We are starting the complete overhaul of our push implementation that will allow us to deliver improved push related fixes/features and provide more reliability to the push service. When we designed our push offering initially it was focused around the limitations of Google App Engine which we are finally phasing out. The new servers are no longer constrained by this can scale far more easily and efficiently for all requirements.

Read More
Post Image

Java Mobile Development Webinar 2: The Sequel

On Thursday morning we rolled the cameras for chapter 2 of our exciting new webinar series. This time around there were far fewer (though not zero) technical issues, and we were able to share a productive hour of mobile app development in the company of our fellow coders.

Read More
Post Image

Deprecations, Simplified cn1lib installs & Theme Layering

We decided to discontinue support for building without a certificate, this support was added initially because generating an iOS certificate was so difficult and we wanted developers to see that "it works" before committing to the expense. However, this process is wrought with bugs that are often hard to trace back and error prone. Added to that is the fact that we now have the new certificate wizard which makes the process simpler thus removing the final blocker (no need for a Mac).
We will block this functionality in the build servers by next week and thru the plugin after that.

Read More
Post Image

StartApp integration

When StartApp first launched a few years ago, they were a unique innovative new monetization channel to make money on Android.

Read More
Post Image

Building A Chat App With Codename One Part 5

The chat UI is what we've been working at and in todays post we are going to build exactly that!
Even better... We'll integrate with Pubnub to make the app almost fully functional as a rudimentary chat app, which is pretty spectacular. In this section we'll cover UI, storage (externalization), Pubnub & its JSON API... We'll also use `InteractionDialog` to show notifications of incoming messages...
Before we get started you will need to login to pubnub.com and sign up for an account where you will get two ID's necessary when subscribing and pushing.

Read More
Post Image

Java Mobile Development Webinar Recap

Tuesday morning I held a webinar on Java mobile development using Codename One. First of all, I'd like to thank all who signed up and attended. Unfortunately there were some technical difficulties with the Webinar software that caused some major glitches. Double thanks to those who endured and stayed to the end. We've learned from this experience and we will do better in future webinars.

Read More
Post Image

Introducing Codename One WebSocket Support

Codename One already has two separate socket APIs: a low-level API similar to java.net.Socket and a higher-level event-based approach. So why do we need WebSockets?

Read More
Post Image

Building A Chat App With Codename One Part 4

This tutorial is starting to get interesting.... In this section we'll go deep into animations, special effects, search styling and extracting contacts. In the previous sections we built the first form of the app, logged in and now we need to show the actual login form. Even more importantly we need to show it with style like this:

Read More
Post Image

Building A Chat App With Codename One Part 3

In the previous section we went over the login with Google process, in this section we'll go over the login with Facebook. At this time we'll skip the "invite friends" option since that is blog post all on its own and we can just add that functionality to the completed application.

Read More
Post Image

Building A Chat App With Codename One Part 2

In the second part of this tutorial we will cover the login process for Google and getting a unique id. We'll try to write generic code that we can later reuse for the Facebook login process. But first lets cover what "signing in" actually means...

Read More
Post Image

Building A Chat App With Codename One Part I

In this tutorial we will cover the basics of building a good looking chat application with Codename One that will work on all mobile OS's. We will cover everything from design to social network login and the actual chat behavior.

This project is created with the new Java 8 support to make the code simple and short. This tutorial is for a hand coded application mostly because GUI builder tutorials require video and are thus less searchable.

Read More
Post Image

iOS Certificate Wizard

So you have finished your app and tested it on the simulator. Everything looks good. You're now ready to proceed with testing on your iPhone. You select the "Send iOS Debug Build" menu item and wait for the build server to work its magic, but then you're faced with a notice that iOS builds require a valid certificate and provisioning profile. What a hassle!

Read More
Post Image

Java 8 Support

When we introduced Codename One initially we limited the API to CLDC level which is roughly a subset of Java 1.3, we then added support for a subset of Java 5 and we are now adding Java 8 language features!
Thanks to some work from Steve and the great work done by the guys from the Retro Lambda project we were able to add compatibility to the major Java 8 features, most notably lambda expressions. This is highly experimental and some features might not work but so far it seems things are functioning rather smoothly.

Read More
Post Image

Login Tutorials & Future Of Windows Phone

Facebook & Google login have been a source of a bit of pain mostly because of the obtuse and confusing documentation from both companies. Chen spent some time writing up tutorials for both Facebook Login & Google Login that should help you get started with applications that use such login options.

Read More
Post Image

Automating Releases

Our website deployment has become even more complex thanks to the demos section. The crux of it is in updating the demos with every small update to the JavaScript build process which is why we implemented a build option based on the work we did for our CI (Jenkins) integration. This work essentially allows to build a Codename One app synchronously which is useful when you want to do things such as continuous integration or release engineering.
Notice that the synchronous build feature is an enterprise only feature since its overuse can have a very heavy toll on our servers.

Read More
Post Image

Shrinking Sizes & Optimizing

Our build servers are really fast, even if your laptop is relatively slow our iOS build servers are powerful machines equipped with fast SSD's and they generate a full clean build of a typical app (with screenshots etc.) in a couple of minutes!
So the real source of delay when building an app is size, it both slows the build but most of all it slows your upload process (upload is typically much slower than download). Reducing the size of your app will make it faster in runtime as well, e.g. if you have too many redundant resources you might be running into too many GC cycles slowing down execution. In this post we provide some tips to shrink your app size.

Read More
Post Image

JavaScript Port Cross Origin, Hints & Bugs

When building to the JavaScript target there are many build options and configurations. More importantly issues like cross origin need server side code that would be able to proxy such requests to make the client side code seamless...

Steve wrote a rather detailed appendix to the developer guide covering all of those options from startup splash screen configuration to servlet proxy logic. The build also generates a ready to deploy WAR file which should make setting this up on any Java servlet container a nobrainer.

Read More
Post Image

Codename One in the Browser

We are very excited to announce the alpha release of the Codename One Javascript port. This brings us one step closer to the coveted _write once run anywhere_ ideal. Starting with Codename One version 3.0, you will be able to deploy your projects as Javascript applications that run directly in the browser.

Read More
Post Image

New Developer Guide

We are rebuilding the developer guide using JBake and asciidoc which means the guide would be better integrated into the website thus providing more accessible hyperlinkable information. This is already making its way into the site and into the PDF so we'd appreciate feedback.

Read More
Post Image

Server Initiated Push

Sending a push notification from the simulator or mobile device is pretty trivial when we use the Push class. However, sending push messages from the server seems to be a bit more complicated for most developers since its not as well documented. The main point of complexity is that we didn't provide any samples of server push code and from the fact that the server expects arguments as POST.

This code should work for Java desktop and server side to perform a simple push, notice that the complexity is mostly related to JavaSE's lack of simplified POST arguments.

Read More
Post Image

HTML Hierarchy, Release Plan & TeaVM

When Codename One packages applications into native apps we hide a lot of details to make the process simpler. One of the things we had an issue with is getResource/getResourceAsStream both of which are problematic since they support hierarchies and a concept of package relativity.
That's a concept that is problematic in iOS, generally everything about file access within the bundle in iOS is a bit problematic to accomplish in a cross platform way because Apple tries so hard to "simplify" and ends up creating fragmentation for us.

Read More
Post Image

Validation, RegEx & Masking

Up until recently we had to handcode validation logic into every form, this becomes tedious as we work thru larger applications. Some developers built their own generic logic, which leads to obvious duplication of effort. In the interest of keeping everything together we decided to release a standardized validation framework that allows us to define constraints on a set of components, mark invalid entries and disable submission buttons.

Read More
Post Image

Geo-Viz and Codename One

Using Codename One's new graphics pipeline it is now possible to start playing with other cool visualization technologies like GeoJSON.

Read More

Codename One Graphics - Understanding Coordinates

Post Image

Codename One provides a rich set of drawing primitives in its Graphics class. It allows you to draw text, shapes, and images to the screen. The position where these elements will be rendered is determined based on a combination of Graphics state information (e.g. the current translation, and transform) and coordinates that are passed to the drawing method. Understanding how these coordinates are calculated can be tricky when you first begin using the API.

Read More

New Free Course: Learn Mobile Programming By Example With Codename One

Post Image

We just released a new online course on Udemy called "Learn Mobile Programming By Example With Codename One". Before a single day went by we already have over 600 students enrolled which is pretty cool. This course is based on the videos we made for the Dr. Sbaitso demo and the PropertyCross demo with some additional videos thrown in to tie everything together and introduce Codename One.

Read More

PropertyCross Demo

Post Image

The new property cross demo shows off the usage of webservices, JSON parsing, infinite scroll, URLImage and lots of other Codename One features. It uses a UK webservice that allows listing properties for sale in the UK.

Read More

Codename One Graphics - Low Level Animations

Post Image

In my previous post, I created a static analog clock component. In this post, I will use Codename One’s animation API to update the clock every continually so that it will keep time correctly.

Read More