Fork us on GitHub

The Move To Java 5 And New Cloud E-Mail Support

We started moving the usages of Vector and Hashtable to use M...

The Move To Java 5 And New Cloud E-Mail Support

We started moving the usages of Vector and Hashtable to use Map/Collection/HashMap & ArrayList. This follows our release of the full source code for our modified version of retroweaver and the Java packages that go with it. Recap: we had to change retroweaver which was designed to allow Java 5 code to run on Java 2 in order to get it to work with CLDC which is missing MANY features.

We started by changing the most important and central features (there is a lot of code that uses old collections, changing it all will be challenging and sometimes not worth the hassle e.g. HTMLComponent). So we changed the TextArea, Component, Container, Display & DefaultListModel to use the ArrayList class. We chose those since they are central and should yield the greatest performance benefit, we also chose them because they are well encapsulated and thus the change should be completely seamless API wise.

We also added Map/Collection support to the Util write object classes and Storage serialization code. So if you pass a vector or hashtable to the code it will act like before, however if you pass a different collection (e.g. ArrayList) or Map (e.g. HashMap) it will be stored properly as well. Right now when we unmarshal (read) the data for a Map or Collection we will always create as HashMap or ArrayList never creating the actual concrete class, the reason we can't do that is that if we saved the class name and it was obfuscated this might break between revisions.

So this was the "low hanging fruit" now comes the tough part... Some developers have asked us in the past to generify some interfaces e.g. EventDispatcher, ListCellRenderer & DefaultListModel. To be honest I'm not so sure how well this will work but I understand the value of being able to do that. I have some concerns about binary compatibility for these cases but from my understanding it should be possible.

How important would this be to you guys?

Do you want to see our common interfaces generified?

As a side note we also added an ability in our cloud server to send email messages directly from the app, which can be pretty useful since it doesn't require a working email account or permissions other than networking. Its only available for pro accounts or higher, and allows you to use the Message API's methods to send an HTML or plain text email directly through our build cloud server. Notice that due to spam issues all emails will arrive from a Codename One address (although you can customize the name of the sender) E.g. to send an email you can do something like this:

Notice: This post was automatically converted using a script from an older blogging system. Some elements might not have come out as intended.... If that is the case please let us know via the comments section below.

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.