Crossplatform iPhone / Android code sharing Crossplatform iPhone / Android code sharing android android

Crossplatform iPhone / Android code sharing


In my experience, you can use Android NDK to compile C and C++ , so if you use iPhone Obj-C++ (.mm) bindings for a C++/C engine in the iPhone, and in Android you use Java bindings to the same engine, It should be totally possible.

So C++/C engine ( almost same codebase for Android and iPhone ) + Thin bindings layer = Portable code.


Like I told someone who asked a similar question a while ago, use MVC and implement the MC in C++ and the V in obj-c or Java.


Write as much as possible in plain old C (or C++ if needed) and just include the same files in Android and iPhone. Works on Windows/Mac too. "cross platform" libraries tend to consume you.