I’ve got an existing, multi-platform game with a variety of technologies providing the controllers.
I was looking to use SDL to unify this, and so far it’s worked well for win32, UWP, OSX, iOS and Linux. Couple of hours for the first one, a few minutes to port it to all the others. All works. Lives in its own folder. Lovely.
Then we get to Android.
Now I knew this would be different, as there’s the Java layer to think about, but the way it’s implemented seems to assume that
You are starting a new Android Studio project from scratch
You want to use ALL the features
I have an existing project, and I only want one of the features. I also would rather not have to copy source files from the SDL folder into my own project (which, if nothing else, makes version upgrades difficult).
Has anyone attempted this before, and if so do they have any tips?
My current best idea is to rip the controller functions out of SDLActivity and crudely stuff them into my own Activity.
OK, I have now got this working. It’s was easily about 10x more effort than the other platforms, but it is possible.
There were a few changes to the Java files that made the port easier, and I’ll look at contributing those back as a patch if people are interested (mostly moving stuff out of SDLActivity into the relevant feature classes).
I did have to make a copy of the Java files and put them in my project folder, which is less than ideal, but that could probably be avoided if there was a JAR file for the Android classes.