-
-
Notifications
You must be signed in to change notification settings - Fork 333
Compiling on Android
To compile on Android, you will need to download and install:
- Git
- Android Studio (compiler)
- vcpkg (package manager)
- Android Library (dependency)
Make sure to follow full installation of vcpkg, per Official Quickstart execute the following in Powershell:
git clone https://github.com/Microsoft/vcpkg
cd vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg integrate install
git clone --recursive https://github.com/mehah/otclient.git
vcpkg install
Extract the android libraries inside android/app/libs folder.
Create a data.zip file containing the init.lua, mods, modules, data and add it to android/app/src/main/assets.
-
ANDROID_NDK_HOMEpointing to the Android NDK root folder (Ex.:C:\Users\Administrator\AppData\Local\Android\Sdk\ndk\29.0.13599879). -
VCPKG_ROOTpointing to the vcpkg folder.
Open Android Studio, click to open project and select the otclient/android folder.
Wait Android Studio synchronize the project and download dependencies.
Navigate through the menu, find "Build" and then "Generate Signed App Bundle or APK..."
Select "APK" and proceed, create a new key, select it and proceed again.
Select "Release" and proceed (Create).
Now, just wait for the compilation to complete and you will have the .apk file in otclient-main/android/app/release, ready to play.