I've used android NDK to make compile shared libraries which I intend to run on Love2d. They work fine and their code is fine. The problem comes into play because I don't know proper way to use ffi.load argument, I've tried the name of the library, no extension, with, with source path and putting it on Documents and linking it through that but that requires that app to have the xml external storage permissions and using the SAF which looks like it'd require me to put Java-lua bridge which I'd like to avoid.
My goal is to have a way to include in my project a selection of .so libraries and be able to use them from the app in an android environment. Has anyone figured this out or have a clever work-around? Any project links with demonstrations would be a nice but not essential bonus. Thanks in advance.
How to use Lua FFI on Android with custom .so's Packaged on the .love
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Re: How to use Lua FFI on Android with custom .so's Packaged on the .love
There's this:
viewtopic.php?p=260947#p260947
But I don't like the way that it creates a copy of the library that'll survive the app uninstall process.
If you find a solution, do post it in here to help others.
Edit: you could also try creating a Lua C module with some functions that glue your desired library, if it's open source. Then instead of FFI.load() you'd use Lua's require(), calling your glue functions that internally call the library.
Something like this:
- https://github.com/Seng3694/CLuaModuleExample
- https://www.lua.org/pil/26.2.html
Edit 2: and also this: viewtopic.php?p=260902#p260902
(The Discord link is on the LÖVE homepage, Community section: https://love2d.org/)
viewtopic.php?p=260947#p260947
But I don't like the way that it creates a copy of the library that'll survive the app uninstall process.
If you find a solution, do post it in here to help others.
Edit: you could also try creating a Lua C module with some functions that glue your desired library, if it's open source. Then instead of FFI.load() you'd use Lua's require(), calling your glue functions that internally call the library.
Something like this:
- https://github.com/Seng3694/CLuaModuleExample
- https://www.lua.org/pil/26.2.html
Edit 2: and also this: viewtopic.php?p=260902#p260902
(The Discord link is on the LÖVE homepage, Community section: https://love2d.org/)
Re: How to use Lua FFI on Android with custom .so's Packaged on the .love
Thanks so much for the link! I'd thought about doing just that as I was learning about how android handled data but did not have the confidence or technical knowledge to go through with it. I'll definitely be trying this soon. Thanks so much
-
- Prole
- Posts: 1
- Joined: Mon Dec 23, 2024 5:15 pm
Re: How to use Lua FFI on Android with custom .so's Packaged on the .love
It appears that link is broken, as it tells me it is expired when I click it.RNavega wrote: ↑Thu Dec 12, 2024 9:48 am (The Discord link is on the LÖVE homepage, Community section: https://love2d.org/)
Who is online
Users browsing this forum: Ahrefs [Bot] and 5 guests