To build the application, Android SDK and NDK are required on the system. The best way to get the SDK and NDK is via AndroidStudio, as this ensures compatibility with the project structure.
The SDK and NDK can be installed either at the initial (one-time) setup for AndroidStudio or via File -> Settings -> Android SDK -> SDK tools
. There, make sure (at least) the following list is selected:
- Android SDK Build-tools
- NDK (side by side)
- Android SDK Platform-tools
After pressing apply
, an installer should appear. Once everything is finished, you can leave the settings. However, make sure that Java 17+ is installed, if not you can install it via:
sudo apt-get install openjdk-17-jdk
Note that SDK 34.0.0
and NDK 25.1.8937393
were used during the development (see 3rd party applications for more detailed info)
The app can be built via AndroidStudio or by running
./gradlew clean
./gradlew assembleDebug
inside the simulation
folder. The apk
can then be found at simulation/app/build/outputs/apk/debug/app-debug.apk
. For a release version, you can run:
./gradlew assembleRelease
However, a valid .jks
key has to first be generated. The apk
will then be at simulation/app/build/outputs/apk/release/app-release.apk
First things first, make sure your Android device is connected. USB debugging from Developers options is recommended to be turned on.
If you connect your phone to AndroidStudio, you can install the apk
simply by dragging it onto the screen. Alternatively, you can run
adb install -r ./app/build/outputs/apk/debug/app-debug.apk
from the simulation
folder to install the apk
.
The following list of 3rd party applications was used in this project:
- zlib 1.3.1
- hdf5 1.14.4.2
- netcdf-c 4.9.2
- netcdf-cxx 4.3.1
The libraries above have already been compiled for Android into shader objects (.so) and included in the project. Thus, there is no need to recompile them. However, follow the simulation/third_party/
instructions if you need to recompile them anyway.
The following 3rd party C++ libraries were used in the native implementation:
- GLM 1.0.1
- ThreadPool
For compiling and building the project for Android, the following list of tools was used:
- NDK 25.1.8937393
- Android SDK Build-Tools 34.0.0
- Android SDK Platform-Tools 35.0.1
- CMake 3.22.1
- Gradle 8.4
All the code is located in the simulation folder.
To see third-party libraries and how to (re)compile them, see simulation/third_party. The precompiled (shared) third_party libraries files can be found at jniLibs.
The Java code is located at java.
The C++ code is located at cpp. The (pre-defined) project settings can be edited using config.txt
The app layout can be adjusted using activity_main.xml