Hello, I would like to know how I can run external libraries on android,
I installed libraries using luarocks on my PC, then I copied the files into my directory inside a lib/ folder and changed the requirepath and cpath, I then sent my files to mobile using an FTP server and opened the lua file with Love for Android (Or whatever it was called) using X-plore app, now it worked fine on my PC but when I opened my libraries (the .so files, to be more precise), it told me that the infrastructure was different (arm compared to x86_64) and it just didn't run
How would I go about making libraries such as lpeg or cqueues work on android? Thank you for reading ...
External Libraries with Love Android
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Prole
- Posts: 2
- Joined: Thu Jan 12, 2017 11:51 pm
Re: External Libraries with Love Android
Well of course you can't run x86 binary code on ARM processor, the same way you can't run PlayStation games on XBox - it's pretty basic thing to know about cross platform distribution, that each platform requires its own build. What you need to do is download source code for your packages and build them as Android-compatible ARM Shared Object files, that'll produce .so files that can be loaded on Android.
-
- Prole
- Posts: 2
- Joined: Thu Jan 12, 2017 11:51 pm
Re: External Libraries with Love Android
What compiler would build them as arm shared objects that would be compatible with android? Also, what about the dependencies of libraries such as openssl or the configuration that is related to arm environments and demanded by those compilersraidho36 wrote:Well of course you can't run x86 binary code on ARM processor, the same way you can't run PlayStation games on XBox - it's pretty basic thing to know about cross platform distribution, that each platform requires its own build. What you need to do is download source code for your packages and build them as Android-compatible ARM Shared Object files, that'll produce .so files that can be loaded on Android.
I went that way, but because I really was going in blind, my results were mediocre and I had to deal with a lot of problems... Now... if someone else managed to do it themselves, that's another story...
Re: External Libraries with Love Android
Android SDK and NDK should have everything you need to build your files. If you build from source code, dependencies you'll of course have to resolve yourself. The sure way to do this is to place dependencies in a sub-folder and include them in build list, to hard-embed them into your binaries.
But do try your luck with web search about having luarocks to build for Android.
But do try your luck with web search about having luarocks to build for Android.
- Positive07
- Party member
- Posts: 1014
- Joined: Sun Aug 12, 2012 4:34 pm
- Location: Argentina
Re: External Libraries with Love Android
Similarly, you could statically link the libraries to the APK, for examples just check how LuaSocket and Lua-ENET are statically linked to LÖVE
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot], Semrush [Bot] and 5 guests