How to use the program including DLL on Android?

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
farhad abedini
Posts: 3
Joined: Tue Nov 07, 2023 4:40 pm

How to use the program including DLL on Android?

Post 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
User avatar
Kjell
Posts: 1915
Joined: Sat Feb 23, 2008 11:15 pm

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

Post 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
User avatar
Ats
Posts: 770
Joined: Fri Sep 28, 2012 10:05 am
Contact:

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

Post 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.
Post Reply