fnc12 / Mitsoko

10 stars 1 forks source link

Several questions about Mitsoko #1

Open bilsou opened 7 years ago

bilsou commented 7 years ago

I just discovered your library lately and doing mobile C++ development myself for some time now, I can only say that what you have done is an amazing job. I have previously been using manual bindings for both iOS and Android (via JNI) but lately I am using Djinni. But it has limitations which your lib seems to overcome. I have few questions though: Have you been able to use it in a production app ? In the same way how well tested the library is ? Do you have any documentation/example on how to use it ?

Thanks in advance for the details you could give me.

fnc12 commented 7 years ago

@bilsou thanks for using the lib. It is good that the lib is useful. Yes there are several production projects made by me on freelance:

These projects are local and built for my homeland (Kazakhstan) except Jako.

You can preview an example app in my another repo. Just clone it and open in Xcode/Android studio and run (don't forget to specify path to Android NDK and use CrystaX NDK not Google NDK)

Lib isn't tested cause I don't have much time for it cause I have another open source project sqlite_orm. But right now there are two more projects are being developed by my with mitsoko on my basic job.

My plan is creating a framework just like cocos2d-x but useful for business apps with features:

Also I have a python script that creates modules in the core. One module represents one ViewController on iOS and one Activity/Fragment on Android. Every module has view and presenter. View has OS related code like

#ifdef __ANDROID__
myTextView().setText("ototo");
#else
myLabel().setText("ototo");
#endif

and presenter has OS independent code like

view.didAppear = [=]{    // viewDidAppear: and onResume callback
    view.promtName([=](std::string name){    // shows UIAlertView and android.app.AlertDialog
        storage.saveName(name);
    };
};

Please check it out in example project.

If you want to create a new project with mitsoko just clone a template and start modifying modules. Or you can just clone this repo and link it with Xcode and Android Studio projects. But for the second way you also need objc and java helper classes that located in example project (NI, network classes, callback handlers etc). If you have any more issues feel free to ask. Thanks

bilsou commented 7 years ago

Thank you for your quick reply. Good to know it's been used in production, even if it has not been fully tested yet, it makes it more worthy to me. I had a quick look at the template, it does look like quite a simple example using only a small subset of your lib's features but I will make sure to go deeper to understand how your lib works. It really looks good in any case, I wanted to build a C++ cross platform lib like yours for a long time, and I even wanted to add a native UI layer to it but I never had the time.
It would be great to see a more real life example like an app that would connect to a REST API and present some Json in a list view or something. It would give a better idea of how everything works on both platforms. Anyhow thank you again, I will check it out and will get back to you if I have any question.

fnc12 commented 7 years ago

@bilsou there is rest api service in Mitsoko/Url/ dir. It's used in my production apps. It has Mitsoko::Url::Request class with functions for assigning http method, http body with string or multipart, headers and sending it async with NSUrlConnection on iOS and AsyncTask on Android. Disadvantage is that there is no example in open source. I'll create one soon. Json can be added with any c++ json lib. I like nlohmann's json. UITableView and ListView can be populated with adapter defined in Mistoko/TableListAdapter.hpp source. Sorry, there is no example with it yet. I'll add an example with routing, http rest, json and table view example (probably request for countries from vk.com and populating UITableView/ListView with then).

bilsou commented 7 years ago

That would be great, I look forward to looking at your example, as it would allow me to see how to write a "real" cross platform app example with your lib.

fnc12 commented 7 years ago

Please check out the latest commit in example project. It has two modules (controllers/activities), http api service, data model class with json serialization and deserialization (using https://github.com/nlohmann/json), routing (switching from one viewcontroller/activity to another using wireframe member in presenter) and table/list-view populating using crossplatform adapter.

You can open the project both in Xcode and Android Studio (for Android please use CrystaX NDK not Google NDK cause Google NDK misses some functions from stdlib) and run it. Feel free to ask any question here on in the template repo.

Also I plan to add CLI utility for creating project and managing libs in Core/libs dir.

fnc12 commented 6 years ago

bump. Is the issue still alive?