SFML community forums
General => General discussions => Topic started by: madcat on August 26, 2017, 02:26:03 pm
-
Hi You All,
has anyone had any success building a minimal SFML example that can actually be built and run on the emulator?
I've tried the tutorial on GitHub (here: https://github.com/SFML/SFML/wiki/Tutorial:-Building-SFML-for-Android (https://github.com/SFML/SFML/wiki/Tutorial:-Building-SFML-for-Android)) - with no success since those **** people at Google decided to force you to go through their ugly IDE: Android Studio.
So I've spent so far 36h on the problem and I believe that I'm getting closer: the best lead I've found so far is here in the forum and t AlexAUT's SFML-AndroidStudio-Template (here: https://github.com/AlexAUT/SFML-AndroidStudio-Template (https://github.com/AlexAUT/SFML-AndroidStudio-Template)).
There's also a this basic yet rather rich article on dev.android: https://developer.android.com/studio/projects/add-native-code.html#create-sources (https://developer.android.com/studio/projects/add-native-code.html#create-sources)
So I started from these places and I am painfully trying to merge two of their examples
- Native Activity - using <android_native_app_glue.h>
- Native Lists (Hello libs)[/i]
from there I hope to find a way to bring in the static and shared libs for SFML.
did I mention that Java irks me?
Any clue is welcome!
-
There you go!
https://en.sfml-dev.org/forums/index.php?topic=22445.msg157722#msg157722
However, it is required you compile SFML for android with ndkr12b
You then can use the latest available in AndroidStudio, afterwards ;)
-
thanks. ;D
You actually did it maybe 30 minutes before I completed my version.
So I started sniffing around your code and checked out what you did differently.
Short of the way we link libraries and a rather shorter and nicer way of linking sfml-main in your case it was about the same thing. So here is mine, and thanks a lot for your answer!
https://github.com/MoVoDesign/SFML_Template (https://github.com/MoVoDesign/SFML_Template)
-
For mine it wasn't exactly the point to get it done cleanly, but quickly ;)
Edit: little tip:
Use clangs libc++_shared (or static) instead of stlport for full c++11 support!
You however need to build SFML using ndk-r12b only, to avoid the "<ostream>-error"
Afterward you can use the regular, latest and greatest ndk.