I know this has been asked many times, but I could not find anything close to what I want from the existing SO answers.
Basically, we are going to create a complex mobile application that will have the following functions:
- 3D rendering with OpenGL
- Integration with a camera, accelerometer, gyroscope and other hardware functions.
- Networking (HTTP)
- Local Database (SQLite)
- Hard disk usage
- zip files and encryption (OpenSSL)
- Integration with third-party equipment (for example, a third-party sensor connected to the tablet) with its SDK
We want this application to work in the environment of iOS, Android and Windows. Many solutions are considered, including Qt, Xamarin and others, but it seems very risky to use these frameworks in such a complex utility.
What we now mean is the creation of each application initially, but the preservation of as much common code as possible in the shared C ++ libraries.
For example, we would like to create C ++ components for various functions, for example:
- HTTP Server Communication
- File encryption
- Business logic
- ...
However, there is a definite problem. It is not clear how we connect our own user interface layer and C ++ code in libraries. It is easy to call library functions from Java or Obj-C code, but many of them will cause some asynchronous tasks (call the HTTP-url, dump file to disk). It is not clear how to transfer the results of such asynchronous tasks back to the user interface code.
What we ideally want to have is some kind of MvvM architecture, where Views is completely platform dependent, but models and partially ViewModels are written in C ++. In addition, such architectures often use “Services” - they may also have a platform-specific interface, but a C ++ core.
Is there a known way to provide such integration? Maybe there is a library that provides a "middle tier" between the UI code and the libraries?
Or maybe our approach is not at all viable, what would you suggest in this case?