Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 796
SK9 Avatar asked Aug 05 '10 07:08

SK9


People also ask

Can you use Objective-C for Android?

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.

Is Objective-C outdated?

To sum it up, Objective-C, when compared to Swift, is a more outdated language and lacks modern tools and properties.

Is C good for Android development?

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.

Does Google use Objective-C?

Some of Google's iOS apps are completely written in Objective-C.


2 Answers

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/

like image 110
instcode Avatar answered Sep 27 '22 17:09

instcode


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.

like image 26
sdabet Avatar answered Sep 27 '22 17:09

sdabet