J2ObjC vs JUniversal: What are the differences?
What is J2ObjC? Java to iOS Objective-C translation tool and runtime used by Google Inbox to share 70% of its code across Android, iOS, and Web. J2ObjC is an open-source command-line tool from Google that translates Java code to Objective-C for the iOS (iPhone/iPad) platform. This tool enables Java code to be part of an iOS application's build, as no editing of the generated files is necessary. The goal is to write an app's non-UI code (such as data access, or application logic) in Java, which is then shared by web apps (using GWT), Android apps, and iOS apps.
What is JUniversal? A new, Java-based approach to cross-platform mobile apps (used by Google Inbox and Google Spreadsheets). The vision of JUniversal came from some guys at Nokia who possess considerable expertise both in Java and in building cross-platform apps. They built this tool to provide an elegant way to translate source code and make it useful across multiple platforms. JUniversal offers you the freedom to write your shared code in Java and then translate it to C# (available now) or to C++/Objective C++ (coming soon). You can also combine JUniversal with Google’s j2objc translator to translate Java to Objective-C for iOS.
J2ObjC and JUniversal can be categorized as "Cross-Platform Mobile Development" tools.
J2ObjC and JUniversal are both open source tools. It seems that J2ObjC with 5.47K GitHub stars and 771 forks on GitHub has more adoption than JUniversal with 132 GitHub stars and 22 GitHub forks.
What is J2ObjC?
What is JUniversal?
Want advice about which of these to choose?Ask the StackShare community!
Why do developers choose JUniversal?
What are the cons of using J2ObjC?
What are the cons of using JUniversal?
Sign up to get full access to all the companiesMake informed product decisions
This is one of the most amazing open source projects out there. Tom and Kieth do an amazing job working with the developer community and quickly responding to questions and concerns. I was blown away by how solid the ported code was. What a life-saver and a ridiculously awesome tool.
Comment from HackerNews (https://news.ycombinator.com/item?id=8998736)
This is how Google Inbox and Google Spreadsheets works. See the slides from my recently produced GWT Create Session (http://t.co/ZvoaHxCoZT). J2ObjC slide deck here (https://docs.google.com/presentation/d/1mW_Plm5jAygELf7qjVK7...) Videos of the conference will be online soon.
Prior to that, some 20% Googlers also produced the PlayN library (https://github.com/threerings/playn) This was taken over by Michael Bayne who added an iOS backend by Bytecode -> IKVM -> Mono conversion. I beleive j2objc and RoboVM backends exist now as well.
The major benefit of the j2objc approach is the avoidance of GC in favor of ARC, the conversion of message-sends into C-method calls when possible, and integration with existing iOS toolchain.
When we started, it seemed like an iffy idea, but after developing a product delivered to millions of users on a high volume site (gmail) that has 70% code sharing, and being able to simultaneously develop, test, and deploy across the platforms reasonably efficiently, a lot of skeptics have become converts to the concept.
We use J2Objc and GWT to provide a shared library of cross-platform code that is used on all our client platforms (Android, iOS and the web) and even in the backend.