thibault-martinez / iota.lib.cpp

IOTA C++ Library
MIT License
79 stars 21 forks source link

Android compatibility? #181

Open SiliconDroid opened 6 years ago

SiliconDroid commented 6 years ago

Great work guys!

Will this library (and dependencies) build with Android NDK? Would love to eventually build a binary and write a C# interface for a Unity engine IOTA plugin.

P.S. I was told in discord to raise this as an issue by user Thibault.

Cylix commented 6 years ago

Hey,

Thanks for this issue! That's a really good idea and I'll definitely look into it.

We already have a roadmap for the next releases (stable release, performance improvement, cross-platform support and embed support). So these do not include NDK support as of now.

However, I'll keep that in mind and will check the workload to think about when we can do that. Basically, my thinking is that if the workload is not too much, it can possibly be included in the v1.1.0 (cross-platform support). Otherwise, it might be done later depending on the priorities.

You can learn more about our current roadmap/timeline here.

In any case, we will keep you up to date on this issue whenever there is a move concerning this :)

Best

Cylix commented 6 years ago

Little update concerning this issue.

I started to look a little at how Android NDK works. There are basically two main options to use a C++ library with Android:

So I'm gonna have a try for the second option and double check the minimum required API. If any API can support it, then this will definitely be the standard solution to go. Otherwise, for lower APIs, it would require to port the library and, considering the workload it requires, this may be done later on.

I'll update this ticket when I will be done testing and going deeper in my searches.

Cylix commented 6 years ago

Ok, after investigation: yes, the NDK support loading of shared libraries, but only prebuilt one with the NDK tools.

That means that we need to integrate our toolchain to the Android NDK and make changes the front public API to allow conversion from the C++ environment to the Java environment.

I guess the workload to do that is too heavy to integrate that on the side of the other incoming releases. We will probably do an additional release for that after the v2.0.0 as v1.2.0 and v2.0.0 are more critical.