Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Android Studio 2.3.3 + SFML 2.4.2 - Hell again.  (Read 3770 times)

0 Members and 1 Guest are viewing this topic.

madcat

  • Newbie
  • *
  • Posts: 21
  • Creator of TacWars
    • View Profile
    • TacWars
Android Studio 2.3.3 + SFML 2.4.2 - Hell again.
« 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) - 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).

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

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!


Alia5

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Android Studio 2.3.3 + SFML 2.4.2 - Hell again.
« Reply #1 on: August 31, 2017, 03:44:52 pm »
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 ;)

madcat

  • Newbie
  • *
  • Posts: 21
  • Creator of TacWars
    • View Profile
    • TacWars
Re: Android Studio 2.3.3 + SFML 2.4.2 - Hell again.
« Reply #2 on: September 03, 2017, 01:04:13 pm »
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

 

Alia5

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Android Studio 2.3.3 + SFML 2.4.2 - Hell again.
« Reply #3 on: September 04, 2017, 09:07:14 pm »
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.
« Last Edit: September 04, 2017, 09:08:52 pm by Alia5 »