1

There is no way to bring my Windows C++ code over to both Android and iOS easily, isn't it?

My C++ code is mainly only vectors, strings and such "light" stuff, it doesn't have anything to do with graphics.

I thought since C++ is kind of universal, there might be a tiny chance that I could somehow get it to work.

I guess C++ depends on the VS2010 C++ runtime, and therefore I have to write it completely anew, right? Using XCode for iOS and Java for Android...

I guess that is so but perhaps somebody else is more up to date than I am.

tmighty
  • 10,734
  • 21
  • 104
  • 218
  • You can programm in C++ for Android as well :)... See: http://developer.android.com/tools/sdk/ndk/index.html – Pozzo Apps Apr 02 '13 at 14:07
  • Rewrite the UI portion in the platform native language, link to the C++ algorithms core. That's what I'm doing, works like a charm. The code originated on Windows CE, also works on bada and WinPhone 8. – Seva Alekseyev Apr 02 '13 at 17:10

3 Answers3

2

Of course you can definitely bring your code over other platforms easily if you only have cross-platform and standard implementations. In order to port your code to Android you can look at JNI and for XCode you can just create Cocoa static libraries to be used in the objective-C++ projects

fatihk
  • 7,789
  • 1
  • 26
  • 48
2

Yes, you can compile C++ files for iOS and Android, but you'll need to do native things (Objective C, Cocoa) in order to assemble a full blown code-signed iOS app using your migrated C++ functions and likely the same thing on the Android side (leveraging Java) as well.

Community
  • 1
  • 1
Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215
2

I was in this problem for quite a time ago and i found out that if you are going to write applications for ios , you must be knowing Objective C otherwise all the alternatives are just take you away from all the advantages and make your life harder...
but You can use your objective C++ compiler to compile your C++ code :)