Fork us on GitHub

Questions of the Week XXII

contacts, GUI builder, jsr310, timezone, reflection, svg
Post Image

Questions of the Week XXII

We made a lot of changes to Codename One over the past week but eventually decided to postpone the plugin update to next week so we can do more work on the GUI builder. We have quite a few new features and fixes lined up for next week already.

On stackoverflow things were as usual:

how to use phone contacts instead of gmail contacts for social app in codenameone

Getting device contacts is actually easier than getting gmail contacts

New GUI builder from CodeNameOne introduces exception?

There seems to be a problem in the GUI builder IDE integration, this should be fixed in the next plugin update

Save a photo with a specific name and compressed size in codenameone

You can select the size in megabytes in advance but you can monitor the size and control it via resolution change

Java 8 and Java time

Codename One supports a subset of Java 8 with subset being an important keyword here…​ I’d like to explain this into greater details, perhapse with a blog post

Convert time to utc

Timezones are a pain no matter which technology you use, they are just awful

Install Error for iOS

Ideally we’ll mirror and eventually remove the appspot servers completely

iOS Build Server Issue

With the update coming out today we should have more logging that will allow tracking down these issues

Reflection not working in ios in codename one

Dynamic class loading "might" work but it isn’t reliable across platforms and might run into issues with obfuscation or optimizers. You should use class literals instead

Codename One and jformdesigner

Some AWT/Swing GUI builder code can be copied to Codename One "as is" with package names and a few class name changes

Sidemenu customization

We don’t currently support tinting the form on which the side menu is overlaid

How to change the background of an SVG in Codename One

Codename One doesn’t really support SVG’s. We convert them to PNG when importing them to the IDE. We might improve on that in the future but the demand isn’t great…​

How to kill web browser instance after close form

You can explicitly call destroy() but often you need to sign out first

Java Scanner - Mobile App Build Error

Sometimes in the attempts to workaround/fix a problem you create a bigger problem.

how to show gmail contact in android after signin with google in codenaoneone

You can access the Google+ contacts as well as the on-device contacts

Invoke codename code from native interface

There are several tricks to do this listed in the developer guide…​

AdMob ads not showing in iOS

This isn’t the first time banner ads posed a problem, we made a mistake when we integrated them into the build flow and should have integrated them as a cn1lib

showForm - java.lang.reflect.InvocationTargetException

The error message from the simulator is somewhat unintuitive sometimes as it is wrapped in the simulator code. The actual exception was the NullPointerException below the InvocationTargetException

Codenameone plugin giving null pointer exception

Handling the case where the .gui file is missing or in a different location is a bit problematic in the various IDE’s.

Graphics drawing code generates blank images, only on iOS

This is covered in an issue submission so we need to evaluate this thru the issue

Getting line numbers in stack traces

We use the Android VM as-is so the stack trace lines are pretty much what Android gives us

Share this Post:

Posted by Shai Almog

Shai is the co-founder of Codename One. He's been a professional programmer for over 25 years. During that time he has worked with dozens of companies including Sun Microsystems.
For more follow Shai on Twitter & github.