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:
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
-
Clone download the repo along with the submodules:
git clone --recursive https://github.com/altef/heaps-android
-
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.
-
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. -
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 (thendkVersion
) as necessary. -
Build the project, and hopefully nothing too bad should go wrong.