Hi!
I'm trying to write a shared library with Nim to be used in an Flutter Android app. The plan was that I'd compile a .so file, give it to the mobile dev, and they'll just put it next to the source files and call it via Dart's FFI. Worked pretty sweet on the desktop.
But when we tried to make it work with the actual Android Studio projects, things went South.
First off, it turns out, Android Studio must compile the .so file because you can't cross-compile to Android with vanilla Nim. That's OK except I can't get it to work.
For a nim proc that does nothing, I can compile it a call from Flutter. But if the proc touches a file on the FS or even just echoes, the app crashes when the proc is called.
Does anyone have any real-life experience with this sort of development? I'd really appreciate some advice.
The most useful resource so far was this: https://github.com/GordonBGood/NimHelloJNI
Do you have maybe a sample project I could take a look on? I promise to copy your homework so that it's not that obvious :-)
I wonder what kind of project structure it takes to actually have a usable shared lib.