Search code examples
model-view-controllerprogramming-languagesportability

Is it possible to write shared libraries between iPhone, Android, Blackberry, Mac and Windows?


I'm tasked with "porting" a few apps from a Windows environment to various mobile platforms and Mac as well.

I plan on writing MVC patterned apps in which I write as many controllers as I can in some sort of universal library, probably in C or C++. Then writing the views in various choice languages (Objective C, Java, .NET, whatever) for the target OSes.

I've never attempted anything like this before, so my questions are: Is it possible to write and compile one library that can be used on iPhone, Android, Blackberry, Windows and Mac? Is it even wise to try this?

I understand that certain native methods simply won't be available on each platform.


Solution

  • You can create a library whose source code is portable, assuming that you properly abstract away any platform-dependent calls. You can't, however, create such a library, compile it, then use it anywhere; you'll have to compile it for each platform.