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

Author Topic: Android and iOS ports available for testing  (Read 331388 times)

0 Members and 1 Guest are viewing this topic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Android and iOS ports available for testing
« Reply #210 on: May 28, 2014, 09:19:16 pm »
Which comment?
Laurent Gomila - SFML developer

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Android and iOS ports available for testing
« Reply #211 on: May 28, 2014, 09:32:56 pm »
Code: [Select]
    // These sensors are unavailable from the Android C API
    if ((sensor == Sensor::Gravity) ||
        (sensor == Sensor::UserAcceleration) ||
        (sensor == Sensor::Orientation))
        return NULL;

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Android and iOS ports available for testing
« Reply #212 on: May 28, 2014, 11:01:24 pm »
Hmm... yes, looks strange.
Laurent Gomila - SFML developer

AlexAUT

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
Re: Android and iOS ports available for testing
« Reply #213 on: May 30, 2014, 07:07:00 pm »
sf::Music and sf::Sound aren't work on Android for me, is this an known issue? Because everytime I create a instance of Music or SoundBuffer the app crashes (segment fault 11)


AlexAUT

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: Android and iOS ports available for testing
« Reply #214 on: May 30, 2014, 07:08:02 pm »
That might be related to https://github.com/SFML/SFML/issues/621.
SFML / OS X developer

AlexAUT

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
Re: Android and iOS ports available for testing
« Reply #215 on: June 01, 2014, 10:47:09 pm »
That might be related to https://github.com/SFML/SFML/issues/621.

Yeah this fixed my issue.

Another Question: Is it intended that SFML "eats" the volume keys events? Because it's quite annoying when you have to switch out of the app to change the volume of the game.


AlexAUT

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Android and iOS ports available for testing
« Reply #216 on: June 01, 2014, 10:59:12 pm »
Yep, right now it does (and it won't generate key events in SFML). Should probably be something that should be changed for 2.2.

AlexAUT

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
Re: Android and iOS ports available for testing
« Reply #217 on: June 01, 2014, 11:19:27 pm »
Yep, right now it does (and it won't generate key events in SFML). Should probably be something that should be changed for 2.2.

Yeah i changed the source of SFML so the hardware keys (back, volume) send a key event. Simply added sf::Keyboard::Back, sf::Keyboard::VolumeDown. Without these keycodes its nearly impossible to make a game.

Edit: Is there any "real" case where the app should catch the volume keys?


AlexAUT
« Last Edit: June 01, 2014, 11:23:47 pm by AlexAUT »

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Android and iOS ports available for testing
« Reply #218 on: June 01, 2014, 11:31:58 pm »
Added an issue for this: https://github.com/SFML/SFML/issues/622

There could be use cases where you'd like to control something with the volume keys. Take Amazon's Kindle app as a prime example. It doesn't provide sound output by default. As such they're using "volume up/down" as "page up/down" while reading text, which works rather nice. Of course, there's the touch screen as well, but it's just another option.

It's also possible to use Android phones with VR toolkits such as the Durovis Dive. Once the phone is strapped into the thing it's rather tedious to still access the touch screen, but you could provide minimum control through the (still accessible) volume keys.

AlexAUT

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
Re: Android and iOS ports available for testing
« Reply #219 on: June 02, 2014, 12:19:21 am »
Thanks for the examples.

I just noticed that ogg files are still cracking when playing them on android  :'( . I don't want to use wav  8)


Edit: Normalizing the audio removes the cracking like described here: https://github.com/SFML/SFML/issues/310



AlexAUT
« Last Edit: June 02, 2014, 12:47:32 am by AlexAUT »

Sonkun

  • Full Member
  • ***
  • Posts: 241
    • View Profile
Re: Android and iOS ports available for testing
« Reply #220 on: June 07, 2014, 05:34:52 pm »
Hi,

I rewrote the Android toolchain and pushed the change in feature/android_toolchain. However, there's still a bug and if you compile SFML using this new toolchain, Android won't be able to launch sfml-activity.so. I hope to fix that bug soon (it has to do with link options).

Regarding the audio module which is broken: it's all about compiling OpenAL-Soft properly. Unfortunately there's no official version for Android and our two options are:
* https://github.com/AerialX/openal-soft-android
* https://github.com/apportable/openal-soft
I couldn't make apportable/openal-soft work and managed to make the other one work after disabling some audio backend. The CMake scripts that come along are also a bit broken and need to be hacked to work on some platforms. I'm just waiting for the new Android toolchain to work before recompiling OpenAL-Soft for each arches.

There's also a bad news about the audio module: I never got sf::SoundRecorder working and I really don't know how to fix that. Thus SFML 2.2 might be released without any audio recorder features working on Android.
Interested in using SFML with Python ? Try out its Python binding!

Sonkun

  • Full Member
  • ***
  • Posts: 241
    • View Profile
Re: Android and iOS ports available for testing
« Reply #221 on: June 07, 2014, 05:40:04 pm »
Code: [Select]
    // These sensors are unavailable from the Android C API
    if ((sensor == Sensor::Gravity) ||
        (sensor == Sensor::UserAcceleration) ||
        (sensor == Sensor::Orientation))
        return NULL;
Yes, unless I missed something, these sensors are unavailable from the C API and would require to go trough JNI to use the Java API.
Interested in using SFML with Python ? Try out its Python binding!

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Android and iOS ports available for testing
« Reply #222 on: June 07, 2014, 06:01:46 pm »
Code: [Select]
    // These sensors are unavailable from the Android C API
    if ((sensor == Sensor::Gravity) ||
        (sensor == Sensor::UserAcceleration) ||
        (sensor == Sensor::Orientation))
        return NULL;
Yes, unless I missed something, these sensors are unavailable from the C API and would require to go trough JNI to use the Java API.

They're only missing from the headers. Using the values from the SDK docs works for me, though.

As for OpenAL, there'd be a third option from a non-github repository. I either linked it here or on the issue tracker. I haven't checked recently, but I think the biggest hurdle is getting a proper config.h (which I have now). Guess biggest question would be which repository us updated regularly (didn't check the ones above so far).

Going to have a look later today.

Sonkun

  • Full Member
  • ***
  • Posts: 241
    • View Profile
Re: Android and iOS ports available for testing
« Reply #223 on: June 08, 2014, 08:18:27 am »
They're only missing from the headers. Using the values from the SDK docs works for me, though.
Awesome! I wasn't aware of that. I added the missing sensor constants and made the remaining sensors available. The change can be found in feature/android_toolchain branch.

As for OpenAL, there'd be a third option from a non-github repository. I either linked it here or on the issue tracker. I haven't checked recently, but I think the biggest hurdle is getting a proper config.h (which I have now). Guess biggest question would be which repository us updated regularly (didn't check the ones above so far).
Does sf::SoundRecorder work with this version of OpenAL-Soft ?
Interested in using SFML with Python ? Try out its Python binding!

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Android and iOS ports available for testing
« Reply #224 on: June 08, 2014, 08:51:55 am »
Hm... with latest master I no longer get any audio output and then another segfault after a few seconds.