Hello Erel,
I wasn't sure of what you meant by copying to : anywheresoftware.b4a.objects.streams.File.getDirIn ternal()... (I'm sorry, but I'm an absolute beginner in Android&Java world!).
I assumed it was the /data/data/<package name>/file aka File.DirInternal folder
So I tried this:
- In my Java wrapper class, I used your syntax: System.load(File.Combine(File.getDirInternal(), "libmylib.so"));
- Before compiling in B4A,I added the .so file to the File directory , so it was packed it in the DirAssets directory
- In B4A at runtime, I copy the .so files from DirAssets to DirInternal before Diming my first wrapper class object (after testing if it isn't already there)
... and it worked (just returning a string, but it works!).
This is just the thing I was waiting for...: B4A as a neat supervisor, and -hopefully- plain old C code for easy reuse of fast maths code.
Once again, thanks a lot, Erel! This is great work.
PS: For the sake of curiosity, I tried to adb-push the so file in the /data/data/<package name>/lib folder, and it worked with the more standard System.LoadLibrary( "mylib"); syntax.
I wonder if manually including the .so file in a new lib/armeabi folder in the B4A apk would have done the trick? (ie creating automatically the /data/data/<package name>/lib folder with the .so file in it, at install time)? I tried, but obviously, the "tampered" B4A apk didn't install, as it seems to require some extra step (alignment? signing?). It's just for my curiosity, as the above method seems OK
