I'm still trying to compile the Allegro examples, but I'm getting the following error in the Android logs when starting the examples:
java.lang.UnsatisfiedLinkError: No implementation found for boolean org.liballeg.android.AllegroActivity.nativeOnCreate() (tried Java_org_liballeg_android_AllegroActivity_nativeOnCreate and Java_org_liballeg_android_AllegroActivity_nativeOnCreate__)
What could cause this? My phone has a 64 bits ARM architecture, if that helps. Strangely, some applications seem to work and some don't. I'm pretty much stumped.
Note that the Allegro build already compiles all the examples for you... in fact in the build folder you should find a gradle project for each of them which you can just build with gradle (or even open in Android Studio).
And then compare to what you are doing.
[edit:] Or just post your build files here and I can have a look. It sounds to me like you forgot to include the Allegro.aar library in your build.gradle.
Sorry, I forgot to mention, I'm already using the new Allegro 5.3.2 build system. I'm using the following commands to build and run the examples:
cmake -DCMAKE_TOOLCHAIN_FILE=../../../../cmake/Toolchain-android.cmake -DCMAKE_BUILD_TYPE=Debug -DANDROID_TARGET=android-26 -DARM_TARGETS=arm64-v8a ../../../.. make run_ex_draw_bitmap
Android relevant environment settings:
env | grep android ANDROID_HOME=/home/beoran/opt/android/sdk ANDROID_NDK_TOOLCHAIN_ROOT=/home/beoran/opt/android/toolchain/api21-arm64 OLDPWD=/home/beoran/src/allegro5/build/android/arm64 PATH=/home/beoran/.local/share/umake/bin:/home/beoran/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/beoran/.rvm/bin:/home/beoran/opt/jdk/bin:/home/beoran/opt/maven/bin:/home/beoran/opt/go/bin:/home/beoran/.rvm/bin:/home/beoran/opt/android/sdk/platform-tools/:/home/beoran/opt/android/toolchain/api21-arm64/bin PWD=/home/beoran/src/allegro5/build/android/arm64/api21
The strange thing is is that at first, the example compiled and ran correctly, but then after I tried it again when I made some modifications to implement haptics support, it stopped working. I can show the diff of my work, but it's really unrelated to ex_draw_bitmap, so I don't know how that could cause the unsatisfied linker error. If there's anything else you need to know please ask and I'll do my best to show you.
I think if you use api21 toolchain you should use android-21 as target as well.
[edit:] Also, can you post the directory listing of your ex_draw_bitmap.apk (especially the native libraries folder), and the complete logcat of running the apk?
I tried a bit more and I guess it must probably be due to my be my changes, because make run_ex_draw_bitmap does work well on a clean clone of the Allegro5 git repository.
I have attached the diff between current master and my branch. My branch beoran-android-haptics is also online on github at http://github.com/beran/allegro5.
The error traceback I am getting trough adb:
Listing of the contents of the apk file:
I have also attached the apk file so you can inspect it.
Hm, that apk isn't recognized as runnable on my phone. I'll try your haptics branch but stuck at Thanksgiving dinners today and flying to Europe tomorrow... So might be a while.
Probably your phone has a different native architecture. And no problem, I also have a busy private life, I do appreciate your efforts. Meanwhile I will investigate more by myself as well.