love2d / love-android

Android build setup for LÖVE.
https://love2d.org
Other
200 stars 70 forks source link

Better library loading support on Android #227

Closed ImpleLee closed 2 years ago

ImpleLee commented 2 years ago

If one wants to load C library in LOVE on Android, the only way I know is to copy the library to the saving path and load the library from there. Does the situation get better with the newly added GameActivity.getCRequirePath() function (in commit ba0f568f15ba06bfa3f1dfb6b219e9d1b3d3fc0b)?

MikuAuahDark commented 2 years ago

Yes. That commit allows you to put your C modules alongside the APK in the "lib" dir, alongside the liblove.so.

MikuAuahDark commented 2 years ago

Just a side note, you just have to load your 3rd-party module with Lua standard require and it should load it correctly. This change is implemented as part of 11.4 release.

Also a caveat: Placing .so files in save directory and loading that is not possible in Android 10 and later due to W^X restrictions.

ImpleLee commented 2 years ago

Great! Thank you for your great work! We DEFINITELY will try that!