ANDROID_GAMEPAD_ENABLED

Monkey Targets Forums/Android/ANDROID_GAMEPAD_ENABLED

Neuro(Posted 2013) [#1]
Can anyone expand on this a bit? Aside from enabling it in the config, how do we go about testing a gamepad on Android? And any ideas if this can be expand to enable Ouya controllers?


Sensei(Posted 2014) [#2]
Just came across this and I've been thinking about how I can go about adding game controller support for Android in my Monkey game. I didn't even know about this variable.
Anyone have any ideas and as stated above, how to go about using/testing?

Thinking of trying on of these with my Nexus 10.. http://www.amazon.co.uk/Targus-Gaming-Controller-Media-Tablets/dp/B005CCM6EE

Talking of.. any recommended game controllers for Android any of you may have tried?


Sensei(Posted 2014) [#3]
So, nobody know anything about this preprocessor variable then?


computercoder(Posted 2014) [#4]
This is a boolean variable. True = on, False = off. For Android or OUYA you will need to use it on:
#ANDROID_GAMEPAD_ENABLED=True


You can do this at the top of your main game code, or you can set it this way as default in the config file. I prefer to set it up at the game level vs the target config level.

That said, OUYA does need to have this enabled in order to allow the controllers to work. As far as gamepads on other android devices, I've tried the NYKO PlayPad Pro. Its advertised to be a native style controller for Android. However, when I attempted to use the Monkey controls on it, I couldn't get but a few to work as expected. The rest didn't respond to what Monkey has setup for game pads. I haven't tried any other controllers other than this one.

When you do try testing for the controller, try running MAK/joytest banana. It *should* be the best test for it. Be sure to add the directive above to the file before running it on your droid though. Hopefully you will get better results with the TARGUS controller than I did with the NYKO.


dragon(Posted 2014) [#5]
this solution is bad...

1) this do not worked with 2 controller for me...
i looked for code and here is no support for 2 controller

2) PS3-gamepad worked
XBOX-gamepad not worked

3) i had some lags with remote controller (accepted only every 5th key press, if controller is plugged in)

4) do not know why, but plugging controller in usb during app runs, restart this game (or view) and i had 2 parallel PlayMusic at same time...


used device: minix neo x7 mini


so i think i need more robust solution:
like this?
http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.0.3_r1/com/example/android/apis/view/GameControllerInput.java

or did someone else already this?

(need Android 3.1.x / API 12)


computercoder(Posted 2014) [#6]
The only support for 4 controllers I have seen work for an Android device using Monkey is with the OUYA. Mark did a great job getting that working very well. I haven't had any success (so far, and I really haven't dug much into it) trying to get gamepad support on non-OUYA devices. Additionally, I've only ever used Android 4.x or higher with development. When I tried getting the NYKO controller working, I used my Google Nexus 7 (first ten), and very sporadic things happened with using the buttons and controls.