Feeds

Google offers tool to bridge Android and iOS app dev

Translates Java code to Objective-C

Providing a secure and efficient Helpdesk

Google has released a tool aimed at making it easier to port software between the two major smartphone platforms, by converting Java code for Android into Objective-C code that can be compiled to run on Apple iOS devices.

"J2ObjC is not a Java emulator," writes Google's Tom Ball in a post announcing the tool, "but instead converts Java classes to Objective-C classes that directly use the iOS Foundation Framework."

The tool doesn't claim to make writing mobile apps a completely cross-platform affair. For one thing, it only handles the back end. Developers who use it to translate their apps will still need to write new UI code in Objective-C using Apple's iOS SDK.

Using J2ObjC, however, developers can code their core non-UI functionality in Java, then compile versions of those portions of their apps for both Android and iOS from a single code base, rather than maintaining a separate code tree for each platform.

In fact, Ball says, they can even use the same Java code to build web-based versions of their apps using the Google Web Toolkit (GWT), which can translate Java code into JavaScript to run in the browser. All three versions would have identical core functionality, because they would be based on the same source code.

Google says J2ObjC works with most build tools, including Xcode and Make, and that the translation from Java to Objective-C is totally automated. No additional editing of the Objective-C source code output by the tool is necessary.

Ball says J2ObjC supports the full Java 6 language and many of its key runtime features, including exceptions, generic types, threads, reflection, and inner and anonymous classes. It even does a fair job of modeling Java-style memory management in Objective-C. A full list of the supported language translation features is available on the project's website.

To build and use the system, developers will need a machine running Mac OS X 10.7 (Lion) or higher with Xcode 4 or higher and JDK 1.6 installed, plus Apache Maven.

As for how well it works really, Google says the project is "currently between alpha and beta quality," with the initial release given version number 0.8 as an indication of its release status.

"Several Google projects rely on [J2ObjC], but when new projects first start working with it, they usually find new bugs to be fixed," reads a statement on the project homepage. "Apparently every Java developer has a slightly different way of using Java, and the tool hasn't translated all possible paths yet."

If you'd like to join the bug hunt, the full source code for J2ObjC is available now under the Apache open source license. ®

Internet Security Threat Report 2014

More from The Register

next story
Microsoft on the Threshold of a new name for Windows next week
Rebranded OS reportedly set to be flung open by Redmond
SMASH the Bash bug! Apple and Red Hat scramble for patch batches
'Applying multiple security updates is extremely difficult'
Business is back, baby! Hasta la VISTA, Win 8... Oh, yeah, Windows 9
Forget touchscreen millennials, Microsoft goes for mouse crowd
Apple: SO sorry for the iOS 8.0.1 UPDATE BUNGLE HORROR
Apple kills 'upgrade'. Hey, Microsoft. You sure you want to be like these guys?
ARM gives Internet of Things a piece of its mind – the Cortex-M7
32-bit core packs some DSP for VIP IoT CPU LOL
Lotus Notes inventor Ozzie invents app to talk to people on your phone
Imagine that. Startup floats with voice collab app for Win iPhone
prev story

Whitepapers

Providing a secure and efficient Helpdesk
A single remote control platform for user support is be key to providing an efficient helpdesk. Retain full control over the way in which screen and keystroke data is transmitted.
Intelligent flash storage arrays
Tegile Intelligent Storage Arrays with IntelliFlash helps IT boost storage utilization and effciency while delivering unmatched storage savings and performance.
Beginner's guide to SSL certificates
De-mystify the technology involved and give you the information you need to make the best decision when considering your online security options.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.
Secure remote control for conventional and virtual desktops
Balancing user privacy and privileged access, in accordance with compliance frameworks and legislation. Evaluating any potential remote control choice.