[quote=“utunnels, post:24, topic:1726”]The make file is Android.mk, the goal is to generate libsdl2.so and libDDA.so that can be used by the app.
libsdl2.a (static) is already compiled so I included it in jni/lib folder. The toolchain allows precompiled libs as source, it will link it and produce libsdl2.so (dynamic), don’t copy it manually, the toolchain will do the job for you and overwrite the result.[/quote]
I see you’ve done some kind of emulator with that template previously. Me too, I’ve done MAME port and I also emulated joysticks, and trackball and steering wheel, only not with touch screen but through tilt sensor controls:
https://play.google.com/store/apps/details?id=com.ctMAME
I didn’t really care to learn anything about the SDK other than to just get it compiled, and what I knew I forgot as soon as it worked and I didn’t need to worry about it. But I do know what I did is to have regular makefile for native part of the code, with defined path pointers to SDK folders and the tool-chain, like this:
BASE_DEV=c:/android/android-ndk-r7/platforms/android-8/arch-arm
CC = c:/android/android-ndk-r7/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-gcc
… and then I would compile it normally with “make” command, then manually copy the lib to libs folder and from there did the rest as you do. I had no idea all those things were defined internally somewhere within NDK and that “ndk-build” command could do it all automatically.
Anyway, I pulled that computer with Android SDK from my garage finally and it compiled your project just fine, after some 20 or so minutes, although I first had to update the project to use the targets and SDK I had already installed on that computer, by running this command:
android update project --name catDDA --target 8 --path ./
So then I enabled auto-rotation and there are problems. Rotating the screen exits the application, font size is hard coded and it doesn’t stretch properly. Beside sorting out input mechanics I’d say those would be the first things to address in order to make this port actually playable across many Android phones. Are you plaining to work on these things? Are you going to make it use SDL_ttf?
In any case you did the hardest part, from here on it’s easy. Thanks for that. Just one more thing. When I modified some files and went on to recompile it “ndk-build” command wanted to compile all the source files from scratch all over again, as it seems it had deleted object files when it moved those libs automatically after the first compilation. I had no such problems with my project since I was doing it all manually, and so funny enough I really have no idea how these SDK tools actually work and have to ask these most basic questions even after I spent almost a year working with it. So please tell me: what do you do about it, how to make it re-compile just the files that changed since the previous compile?