Skip to content Skip to sidebar Skip to footer

Objective-c To Java Cross Compiler

It is clear that cross compilers will not be allowed by the Apple App Store, so a developer will need to be familiar with Objective-C to create applications for the iPhone. I was

Solution 1:

I've not heard of a cross-compiler that will do what you are asking. Even if one did exists, the bigger problem would be that the frameworks (UIKit, CoreAnimation, etc) are vastly different between the two platforms. Without some sort of common frameworks, all of the code interfacing with the frameworks will have to be reworked.

Solution 2:

Not a chance. In general, translating from a low-level language like C to a (ever so slightly ) higher-level language like Java is going lead to some very sub-optimal code.

But that's not even the worst part - you'll need to translate between two extremely-different application models as well. You'd either have to re-implement most of Cocoa Touch as a shim over Android, or try to figure out what the iPhone app is actually doing and crank out equivalent Android idioms.

A much more likely path would be something like GNUstep, but I don't know if anyone is seriously looking at implementing the UIKit layer for GNUstep, and you'd end up with a native application at the end, rather than a Java app.

Solution 3:

There is one project, called XML Virtual Machine, that does sth similar to what you are asking. I was interested in that before i got to know the Objective-C. As far as I knew, cross compiling from Java to iPhone was possible(with some limitations). Project is still in development. You can checkout its webpage at XML VM webpage.

Maybe ppl from XML VM could answer your question(if they plan on creating cross compiling from Objective-C to Java).

But I still claim that making the application twice(for each platform using different languages and tools) would definitely give better results.

Solution 4:

Yes, there is an app which converts Objective-C to Java. You will still need to know some Java but it saves you a lot of time porting to Android. It comes with an Android compatibility project which you can add as a dependency in eclipse. It has customizable type and method mappings and you can specify method mappings using a template system.

Check it out here... O2J - Objective-C to Java Converter

Here's their how-to video... O2J Howto Video

Solution 5:

The problem with such a compiler is it would produce terrible applications. Android has a (better) different model of how the application is structured - while a iPhone application is more traditional, an Android application is much better integrated into the system (via activities, view, services and intents).

The biggest challenge is not the main code, but the UI and system libraries. If all views were XIB, there is a small hope.

Post a Comment for "Objective-c To Java Cross Compiler"