Ken
Ken

Reputation: 31161

Android and Objective-C

I'm completing a project for the iPhone entirely written in Objective-C. I'd like to port this for Android too.

While the user interface of the iPhone and the Android OS are very different and will need different code, can I some how import the core of my code (ie. the black box that does the thinking) as is to Android as part of some Java code?

I have no familiarity with bridging between Objective-C and Java even though I have written in both.

Upvotes: 5

Views: 997

Answers (4)

sdabet
sdabet

Reputation: 18670

You could have a look at Apportable which allows to generate an Android app from an existing Objective-C code base. See this article too.

Upvotes: 2

instcode
instcode

Reputation: 1497

You got luck! Phil Hassey has recently ported his own game from iPhone to Android within a week and wrote up what he did steps by steps. Here is his journey: http://www.philhassey.com/blog/2010/08/03/porting-galcon-using-the-android-ndk/

Upvotes: 3

millenomi
millenomi

Reputation: 6589

I have been doing a lot of work on this front — for example by creating my own C++ base framework that does not depend on STL (called Platform Core) and writing the core of the next version of my iOS app with that, so that I can easily port it to Android and whatever else has a C++ compiler and strikes my fancy.

I suggest having a (ick, I can't believe I'm about to say this, but eh), ahem, having a C++ core (there, I said it!) so it can be easily ported.

Upvotes: 1

Nikolaus Gradwohl
Nikolaus Gradwohl

Reputation: 20124

there is a fork of the gcc that supports objective-c on the android by patching the NDK on http://code.google.com/p/android-gcc-objc2-0/. But it's considered beta at the moment and i'm not sure if jni/java bridges are already implemented

Upvotes: 1

Related Questions