Google's Java translator eases path to iPad, iPhone apps

Java-to-Objective-C ( J2ObjC) converts Java code to Objective-C for iPhone and iPad apps

Google on Thursday made accommodations for Java and Python developers by offering a Java-to-Objective-C translator and advancing its Python client library for Google APIs.

With the open source release of J2ObjC, Google has authored a translator to convert Java source code into Objective-C source for iPhone and iPad applications. The intent is to enable developers to write an application's non-UI code, such as data access code or application logic, in Java. Apple has not permitted Java to run on its iOS systems (though Java code can be part of an iOS application build), while Objective-C is Apple's development language of choice for the devices.

[ Despite recent troubles, don't look for the community to abandon Java. | Think you know Java? Test your programming smarts in InfoWorld's Java IQ test. | For tutorials and news on Java, subscribe to InfoWorld's Enterprise Java newsletter. ]

"J2ObjC is not a Java emulator but instead converts Java classes to Objective-C classes that directly use the iOS Foundation Framework," Google engineer Tom Ball said in a blog post. "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."

Developers can go to the J2ObjC project page for instructions on using the tool. Described as being between alpha and beta quality, J2ObjC does not provide a platform-independent UI toolkit.

With the Python Client Library for Google APIs project, Google is featuring a core Python library for accessing Google APIs, a Python client library for OAuth 2.0, and sample applications using these two libraries. The technology is now out of beta, Google developers said.

"If you are building a Python application that uses Google APIs, we strongly recommend you use this client library. First, the library makes it simple to call any RESTful Google API and grab the data returned by the call. Also, the client library handles the OAuth 2.0 authentication protocol and all errors for you without the need to write any additional code," said Joe Gregorio and Antonio Fuentes of the Google Developer Team, in a blog post.

This article, "Google's Java translator eases path to iPad, iPhone apps," was originally published at InfoWorld.com. Follow the latest developments in business technology news and get a digest of the key stories each day in the InfoWorld Daily newsletter. For the latest developments in business technology news, follow InfoWorld.com on Twitter.

Copyright © 2012 IDG Communications, Inc.