I've done some research and one method used for cross-platform mobile application development is to use the lowest common denominator approach, packaging platform-independent functions in a shared C++ code base, and developing the platform-specific ones in the SDK's native language.

I understand the advantages of this approach, we get to reuse as much code as possible instead of rewriting what is basically the same code in 2 different languages. Because of that, we reduce the development time and simplify the process of maintaining the application in the future.

As for disadvantages, I know so far that not everything can be shared, and we would still need to make a thin wrapper between the native language and the shared base. The shared base itself also isn't 100% portable, and may be recompiled for each architecture. Then we have C++ being a more verbose and time consuming language than Java/Swift.

Can I be enlightened with the details of what are the strengths and weaknesses of this method for simultaneous cross-platform development? Perhaps someone who have had experience with this method could kindly explain the hard limitations imposed/lifted by taking this approach.

  • 2
    The obvious disadvantage is that you have to use C++... ;) – David Arno Mar 6 '17 at 9:17
  • Yea, true. I guess I just want to know if that is all, or is there anything else that I have to take into consideration? – Kitson Mar 6 '17 at 9:37
  • I have edited my question after more readings about on-topic and off-topic questions. Is my edit still considered off-topic? If so, may I know if the scope of the question itself is off-topic, or is it the question worded poorly that it attracts answers that are not fit for this forum? – Kitson Mar 7 '17 at 2:37
  • 1
    On Android the UI is written in Java so you need to call from C to Java using the JNI bridge which is slow. Probably not noticeable for most use cases but a bit of a sacrifice for something like this. C/C++ makes sense for cross platform games where you bypass the UI and go directly to the hardware. I wrote this article with a guideline on how to pick from the various cross platform options out there linkedin.com/pulse/… – Shai Almog Mar 7 '17 at 20:12