Recommended: Sing it, brah! 5 fabulous songs for developers
JW's Top 5
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Page 5 of 5
if ( self.notes != NULL ){
AutoReleasePool_release___java_lang_Object(self.notes);
// Release old object we don't need it anymore
}
self.notes = ca_weblite_crossmobile_shared_Note_getNotes__();
// calling static java method ca.weblite.crossmobile.shared.Note.getNotes()
if ( self.notes != NULL ){
AutoReleasePool_retain___java_lang_Object(self.notes);
// Retain the new object in the heap for GC
}
It is very nice to be able, once again, to write libraries in Java and deploy them everywhere. Each tool that I have discussed in this article has strengths and weaknesses. Codename One is the only Java iOS tool that currently comes close to the old "Write once, run anywhere" mantra, and it provides the most coherent development experience. I recommend checking it out if you're looking for a cross-platform environment for writing mobile apps.
If you would prefer to use Apple's native tools for your user interface, so that you can access all of Apple's cutting-edge libraries, then J2ObjC is a good option for sharing business logic.
I believe that XMLVM is among the most brilliant software development inventions of the past decade. Starting out as an academic research project that served as a proof of concept, it has enormous potential for bridging gaps between different platforms, and many of its most powerful uses may yet be discovered. XMLVM has already been used to successfully port apps from Android to HTML5/CSS/JavaScript and from Java to C, Objective-C, and C#. With a little bit of sweat, people-power, and ingenuity, perhaps it could be expanded into some sort of universal translator between all programming languages.
However, if your goal is simply to write Java applications and deploy them on iOS devices, XMLVM may not be the most practical tool for your needs. The save/compile/test cycle can be quite slow because the Java .class files could be converted into a couple thousand C source files that all need to be recompiled in Xcode. At its most practical, XMLVM currently serves as an engine for other tools like Codename One. (See the Codename One SVN repository for some great examples of XMLVM in action.)
RoboVM is a brand new Java-to-iOS tool that has much potential. Currently at release 0.0.1, it isn't quite ready for production as it is still missing many Cocoa bindings, and many features aren't yet implemented. However, it has a strong foundation in LLVM, and some very nice tools for interfacing with the native environment. I think it won't be long before RoboVM is ready for showtime.
Avian caters to a slightly different market than the rest of these tools. Its simple lightweight JVM makes it extremely portable to many different platforms, but its lack of Cocoa bindings and compatibility libraries makes it a less-than-ideal choice for writing Java applications for iOS. Avian could be used as the foundation for other tools that might allow developers to deploy Java onto iOS, however.
This article has been a brief survey of five open source tools for Java iOS development. You can learn more about the tools by visiting the Resources section and checking out examples on their individual websites. If you find that you love working with a particular tool, consider joining the developer community and contributing to making the project even better. All of the tools discussed in this article are open source, so any contribution you make will go toward building a more vibrant Java ecosystem.
Steve Hannah works as a software developer for Simon Fraser University in Vancouver, Canada, where he develops enterprise solutions using such technologies as PHP, MySQL, HTML5/CSS/JavaScript, and, of course, Java. He develops and maintains Xataface, an open source framework for building data-driven web applications, and has contributed to many other open source projects, both in documentation and code. He periodically writes about Java, mobile development, and other software related topics on his blog.