Skip to content

Compiling on Android

Majesty edited this page Feb 3, 2023 · 1 revision

Android Studio with vcpkg

1. Download/install the required software

To compile on Android, you will need to download and install:

2. Set up vcpkg

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

3. Download the source code and install vcpkg dependencies

git clone --recursive https://github.com/mehah/otclient.git
vcpkg install

4. Copy the Android Libraries

Extract the android libraries inside android/app/libs folder.

5. Copy data.zip to Android assets

Create a data.zip file containing the init.lua, modules, data and add it to android/app/src/main/assets.

6. Create Environment Variables:

  • ANDROID_NDK_HOME pointing to the Android NDK root folder (Ex.: C:\Users\Administrator\AppData\Local\Android\Sdk\ndk\25.1.8937393).
  • VCPKG_ROOT pointing to the vcpkg folder.

7. Build

Open Android Studio, click to open project and select the otclient/android folder.

Wait Android Studio synchronize the project and download dependencies.

Create an new emulator to run the project or plugin your own android device.

Click on Play Button or just Shift+F10 to run the project.