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.
In addition to the compiler you'll also need the Objective-C runtime, which exists open-source as libobjc2 and works on Android. With this, and using GNUstep as an implementation of the Objective-C frameworks (i.e. Foundation) you can absolutely use Objective-C code on Android.
To sum it up, Objective-C, when compared to Swift, is a more outdated language and lacks modern tools and properties.
Google offers the native development kit (NDK) that uses native languages like C and C++ for Android development. But you can't build an entire Android app with C or C++. You need to learn Java.
Some of Google's iOS apps are completely written in Objective-C.
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/
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With