The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
[Android] Joystick support
josebagar


Joined: 10 Dec 2010
Posts: 87
Hi everybody,

I've got joystick support working with SDL 2 HG in Android. The code is a bit roguh but someone has been able to use it to create an Android game (http://www.pixjuegos.com/ripolles-ouya.apk) that supports joystick input in Android 4.1 or over.
It's a bit rough around the edges and needs some work at some points but what bothers me is that I wrote the code for an older version of the SDL HG code and the joystick API seems to have changed (and my code is not working anymore).

I'll probably need a bit of help to polish the code but I'd like to know how to proceed: should I upload the patch as is to the HG and improve it there or should I do that here and only submit a bug report once the code is working with the new API?

Regards and thanks for your time
josebagar


Joined: 10 Dec 2010
Posts: 87
I've submitted a bug report with an attached patch that enables joystick support in Android.
http://bugzilla.libsdl.org/show_bug.cgi?id=1700

The code probably needs some tweaking to meet SDL quality standards, but I'd say it's working fine (provided you're running Android 4.1 or over).

If you test it, please let me know how it works and your ideas on how it could be improved.