Interesting new tool from Google:

Android apps are in Java, while iOS is in Objective C, but this tool allows those who develop in Java an easier way to convert their apps to iOS. Interesting move.

J2ObjC 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 application’s non-UI code (such as data access, or application logic) in Java, which can then be shared by Android apps, web apps (using GWT), and iOS.

J2ObjC is not a Java emulator, but instead converts Java classes to Objective-C classes that directly use the iOS Foundation Framework.  It supports the full Java 6 language and most of its runtime features that are required by client-side application developers, including exceptions, inner and anonymous classes, generic types, threads and reflection. JUnit test translation and execution is also supported.  J2ObjC can be used with most build tools, including Xcode and Make.

You can go to the J2ObjC project page for instructions on how to use the tool, check out the source code and view the list of reported issues.  The site also has detailed design docs for anyone interested in how the translator works.

Related articles

  • Former Sun employees bring Java to iOS with cross-platform SDK
  • Apple clarifies new Advertising Identifier, a non-personal UDID replacement, in iOS 6