# \[Android] Compiling OTClient Redemption Sources

## 1. Download/install the required software:

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

* [Git](https://git-scm.com/download/win)
* [Android Studio](https://developer.android.com/studio) (compiler)
* [vcpkg](https://github.com/Microsoft/vcpkg) (package manager)
* [Android Library](https://drive.google.com/file/d/1Uk-EnQG9svz_5YfuiMAGIViJsnDFttRy/view) (dependency)

## 2. VCPKG:

<details>

<summary><strong>If you don't have vcpkg installed</strong></summary>

Use **Powershell in directory** **C:**

* cd C:\\

• To complete vcpkg installation, run the commands below in **Powershell**:

* git clone <https://github.com/microsoft/vcpkg>
* cd vcpkg
* .\bootstrap-vcpkg.bat
* .\vcpkg integrate install

</details>

<details>

<summary>If you already have vcpkg installed</summary>

Use **Powershell in directory** **C:**

* cd C:\vcpkg

• To update vcpkg installation, run the commands below in **Powershell**:

* git pull
* .\vcpkg upgrade
* .\bootstrap-vcpkg.bat
* .\vcpkg upgrade --no-dry-run

</details>

## 3. Download the source code:

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

## 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.
