Page 1 of 1

How to use the program including DLL on Android?

Posted: Sun Nov 19, 2023 5:43 pm
by farhad abedini
Hi,
I run a program on Windows using DLL, but when I compile it to Android, it doesn't run on Android, what should I do?

Regards

Re: How to use the program including DLL on Android?

Posted: Sun Nov 19, 2023 6:16 pm
by Kjell
Hi,
farhad abedini wrote: Sun Nov 19, 2023 5:43 pmI run a program on Windows using DLL, but when I compile it to Android, it doesn't run on Android, what should I do?
A DLL file is very similar to a EXE file and is therefore platform-specific and will only work on Windows. Android has a similar shared library concept though, using the SO extension instead.

Which Windows DLL are you using? You should check whether the library also has a Android version.

K

Re: How to use the program including DLL on Android?

Posted: Mon Nov 20, 2023 5:42 pm
by Ats
You will need to edit the ZExternalLibrary BeforeInitExp in your project to handle your libraries without the need to have one project per machine.
For example:

Code: Select all

if(ANDROID)
{
  this.ModuleName = "./libZgeBullet.so";
}
else if(LINUX)
{
  this.ModuleName = "./ZgeBullet.so";
}
else
{
  this.ModuleName = "ZgeBullet_x64";
}
And I recommend you to place your .so library in the folder:
ZGameEditor\Android\Template\4.1\libs\armeabi

Otherwise, they could get deleted in your exported Android folder.