mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
46 lines
96 KiB
Markdown
46 lines
96 KiB
Markdown
# Heaps Android - Hello World
|
|
|
|
An Android Studio project for a simple Heaps.io Hello World. *I'm probably not maintaining this*, but it may work and if not it should provide a reasonable starting point. Much of this is cobbled together from:
|
|
- https://github.com/HeapsIO/heaps-android
|
|
- https://github.com/qkdreyer/heaps-android
|
|
|
|
## Structure
|
|
.
|
|
├── app/
|
|
| └── src/
|
|
| | └── main/ # This is where the code goes, split by language
|
|
| | ├── cpp/ # Various libraries are here, plus the c generated from your Haxe
|
|
| | ├── haxe/
|
|
| | ├── java/ # Some necessary Java classes
|
|
| | ├── res/
|
|
| | └── AndroidManifest.xml
|
|
| └── build.gradle
|
|
├── gradle/ # Generated by Android Studio
|
|
├── ...
|
|
└── README.md
|
|
|
|
|
|
## Usage
|
|
1. Clone download the repo along with the submodules:
|
|
`git clone --recursive https://github.com/altef/heaps-android`
|
|
2. Open the directory in Android Studio. I am currently using:
|
|
|
|
>Android Studio Arctic Fox | 2020.3.1 Patch 3
|
|
>Build #AI-203.7717.56.2031.7784292, built on September 30, 2021
|
|
>Runtime version: 11.0.10+0-b96-7249189 amd64
|
|
>VM: OpenJDK 64-Bit Server VM by Oracle Corporation
|
|
>Windows 10 10.0
|
|
|
|
3.Make sure you have the NDK and CMake installed - you can do this in Android studio, by going to **Tools > SDK Manager**, and then clicking the **SDK Tools** tab (it just looks like random text in my version of Android Studio). Make sure **NDK (side by side)** and **CMake** are selected.
|
|

|
|
|
|
4. I was only able to get it to build properly with certain versions of the NDK. Download **r18b** from https://github.com/android/ndk/wiki/Unsupported-Downloads and put it in the `/ndk` directory off your Android SDK directory. You can find this under **File > Project Structure** and then by clicking **SDK Location**.
|
|
|
|
5. It only seems to like the NDK version directories in a certain format, so I named **r18b** `18.1.1` on my computer. If you name it differently, update your project's build.gradle (`app/build.gradle`) and change line 7 (the `ndkVersion`) as necessary.
|
|
6. Build the project, and hopefully nothing too bad should go wrong.
|
|
|
|
## More info
|
|
- [The C code](app/src/main/cpp)
|
|
- [The Java code](app/src/main/hava)
|
|
- [The Haxe code](app/src/main/haxe)
|
|
|