Android is a very special case in the build system. The official channel of distribution (through .APK files) requires
each application to be wrapped around at least one Java Activity instance, which represents a running process.
Because of that, Spelunky_PSP target is built as a shared library instead of an executable. When invoking gradle,
it will in turn run CMake and then bundle artifact libSpelunky_PSP.so to the .APK file.
SDL ships a few Java files, including an activity that will bootstrap the application and then retrieve pointer to the main
function from libSpelunky_PSP.so and call it through JNI. These files are compiled and included in the .APK file, aswell
as other Android-related boilerplate (AndroidManifest.xml, strings.xml, icons).
From the moment of calling main function through JNI until return, the code will be executed in ordinary way as on other platforms.
[x] Update readme's (one in the root directory, one regarding dependency list)
[x] Docker image for Android (CI builds)
[x] arm-v7a is built by default - build multi-arch arm-v7a + arm-v8a APK.
[x] Fix logger, as it's half-broken, numbers logged are corrupted, accepts only one parameter instead of variadic number of args
[ ] Audio is commented out completely (I've cut some corners to make this running, didn't cross-build SDL_mixer), fix this. Decided to leave audio module disabled on Android as it is of no high priority.
No on-screen controls provided - USB OTG with keyboard or some other mean of physical controller required (another TODO, to provide on-screen controls? decided to not provide on-screen controls in this MR, no high priority on Android support)
Quoting myself from the
Building.md
addition:With SDL2 as a platform abstraction layer, accessed via: https://github.com/suikki/simpleSDL/
Audio is commented out completely (I've cut some corners to make this running, didn't cross-build SDL_mixer), fix this.Decided to leave audio module disabled on Android as it is of no high priority.No on-screen controls provided - USB OTG with keyboard or some other mean of physical controller required (
another TODO, to provide on-screen controls?decided to not provide on-screen controls in this MR, no high priority on Android support)