Post Image

TIP: Avoid 2D Arrays

In the first betas of Codename One we had a lot of bugs related to 2D arrays due to XMLVM. We no longer use XMLVM but the recommendation to avoid 2D arrays remains. We still use them in some occasions e.g. in the creation of a DefaultTableModel but the implementation discards them in favor of an ArrayList internally.

Read More
Post Image

TIP: Cross Platform Update Available Strategy

One of the nice things in mobile development vs. desktop is the fact that updates are seamless. We supposedly don't need to worry about them and most newer OS's turn them on by default. This keeps are users with the latest version which is important, e.g. if we fixed a crucial bug or added a new monetization option...

Read More
Post Image

TIP: How to Ask a Question

I deal with a lot of questions every day and unfortunately most of them are phrased in a way that forces me to guess. There are some guidelines on how to ask a question but I think they are mostly pretty bad. Asking a question "correctly" helps you tremendously both in getting a correct answer faster and also in solving your own question. Following these three rules will significantly improve your questions

Read More
Post Image

TIP: Get Stack State (trace) from Java Processes

One of the most frustrating things that can happen to developers is when you manage to reproduce a rare bug but you are not in the debugger when you did that. My kingdom for a stack trace...
But this is also pretty frustrating when you work on a tool like Codename One's designer or GUIBuilder and they suddenly freeze with no visible error. How do you provide a viable bug report for that?

Read More
Post Image

TIP: Create Square Icons

This is inspired by this post that covers the process of creating different icons for different OS builds. But here I'd like to discuss the lowest common denominator and how we got it wrong!

Read More
Post Image

TIP: Border Layout can Adapt to Orientation

Some designs don't work well in landscape/portrait mode and we need to adapt them to fit the orientation of the device e.g. when we have a large graphic element (icon etc.) on top/below and we no longer have room for that element.

Read More
Post Image

Using the Designers Command Line Options

Codename One's resource files contain a lot of details but it's sometimes hard to add elements into the resource file automatically. Recently I wanted to add a better way to add images directly in the new GUI builder. I considered several options and eventually decided to operate the designer tool automatically to do the "heavy lifting".

Read More
Post Image

TIP: Don't use File - Save As in Photoshop, only use Export

This isn't a programming tip, but since we discussed photoshop quite a few times before it's probably an important subject. Especially because we made this exact mistake in those tutorials and I've spent the better part of the day tracking this with no result...

Read More
Post Image

TIP: Don't Use ComboBox

We previously discussed the problems with List and somewhat neglected ComboBox which is a subclass of List. ComboBox has the dubious "honor" of deriving most of the problems List has and adding a slew of its own problems such as two separate renderers, different behaviors between OS's etc.

Read More
Post Image

Tip: Disable Google Play Services

Google Play Services is a proprietary set of tools that Google licenses to vendors under limited conditions. In recent years more and more features go into Google Play Services making it harder to build an app without it.

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

Rating Widget

The two key factors to improve any product are: get help from your biggest fans and learn from your detractors. Obviously there is a lot of nuance to that wide reaching advice...
Rating widgets embody this advice. They prompt a user for a rating. If it's good we ask him to review the app in the appstore and thus bring more users. If it's bad we ask him to tell us why!

Read More
Post Image

3 Image Tools for App Marketing

Every now and again developers ask us how we do the graphics for our posts/promotions and up until recently the answer was "photoshop". While knowing photoshop is still very worthwhile we still like these 3 tools that provide great shortcuts to creating both screenshots and art.

Read More
Post Image

How I Chose my Replacement for Parse.com Part 2

You probably recently received the “Next Steps from the Parse Team” newsletter in your inbox in which you were urged to take immediate action as it pertains to migrating your Parse.com hosted apps.

Read More
Post Image

Open Source cn1libs

When we initially designed the cn1lib file format we looked at jar files as a starting point. We wanted a way to distribute binary libraries that support the native code access, restrictions and ideally code completion.

Read More
Post Image

How I Chose my Replacement for Parse.com

When I first read the announcement that Parse.com would shut down on January 28th 2017, I went from disbelief (it’s probably an early April fool’s joke) to rage (how could they do that?!) to sadness (oh no! it was a great service) and finally to utter confusion (where do I go from here and what do I do with my apps - parse4cn1, two MVPs for clients and an upcoming rewrite of Medex for which I was planning to use Parse.com as backend?). A few months down the line, a lot has happened such as the release of the open source Parse Server (yay!) and subsequently the Parse Dashboard. However, I still had to decide what do with my apps and I guess you have to as well.

Read More
Post Image

Keep Track of Codename One Changes & Duplicates

One of my pet peeves when we switched to github was that email notifications never worked for me. For most repositories I had to setup my own account just to get emails. I'm guessing that this is a common problem for those of us who are used to emails notifying us of changes.

Read More
Post Image

Sticky Headers

Sticky headers was one of the first big requests we said no to. Back in the day a lot of people asked for it but we always shot it down because it was too hard to implement on top of our Swing inspired lists. This predated our Container improvement, InfiniteContainer and InfiniteScrollAdapter.

Read More
Post Image

NetBeans Plugin Update Center

The NetBeans plugins.netbeans.org site has been down for another weekend and has been down again today. This isn't ideal as we like the convenience the official plugin center affords in our update process. However, this blocks installs and updates of our plugin most of which originate from NetBeans.

Read More
Post Image

Clarifying our Support

For years we treated support with a "we'll meet our developers where they are" attitude which is problematic now that we have more than 6 free support channels!

Notice that we didn't include the email/phone support for pro/enterprise users in the list of 6 channels...

Read More
Post Image

Default & Static Methods In Interfaces

In our original Java 8 support announcement post we specifically mentioned the lack of streams but completely missed the fact that default/static native interfaces didn't work. This is now fixed thanks to an alert community member who pointed that out.

Read More
Post Image

Icon Fonts & Old VM Swan Song

While multi-image's go a long way in making your app scalable to various devices, scalable images can be even more convenient. The SVG standard never took off though, its too complex to support in an efficient way on the devices and so its relegated to web applications and even those don't make heavy use of it due to its complexity.
However, icon fonts have gained a lot of popularity in recent years and we used them in the past in Codename One e.g. in the photo demo.

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

Flat Themes, DPI's & Static Initializers

With the release of 3.0 we were overwhelmed with a lot of last minute features and improvements. It seems that we neglected to mention a lot of features that made it into the final 3.0 product.
One of the nicest new features is a set of new flat themes with various colors in the designer and the project wizard. We found that a lot of developers prefer themes with more control over the look, themes that look more similar across platform yet have a more modern "flat" feel.

Read More
Post Image

Gallery, Icons & Updates

Now that the new website is live we are down to standard business again beyond just the typical bug fixes. Chen just updated the gallery support to include the ability to pick a video file and not just an image file...

Read More