Hi all!

I hope I'm not spamming here, as I already made a recent post 3 days ago.

I'm also not sure if I made this too complicate to get some piece of Nim code 
running on android...

I create an empty JNI Android Studio project and used a nimble task to create C 
Code for multiple CPU targets out of my Nim source files. These C files are 
then compiled with CMake together with an Android JNI Wrapper C++ file. As 
sample user interface, I used a small Android Webview with Svelte as JS and 
Bootstrap as CSS library.

One major drawback is, that I couldn't make CMake and Nimble work together in a 
comfortable way so that they could detect modifications of Nim files. So 
currently, all generated Nim C files are always deleted in the beginning, 
re-created for each CPU target, compiled and then linked together (all .o 
files) as JNI interface. This always takes about 40-50s each time I want to 
test some change.

If you have some good idea how to improve this compilation step, let me know. I 
already thought about skipping some CPU target to improve the speed, but I'm 
also new to android studio and I would actually prefer to have some clean 
modification detection... Currently, I make all development without android as 
web-application first and then deploy it to android studio to test it there.

The code with the android studio project is here: 
<https://github.com/marcomq/nimview_android>

Reply via email to