SDL
SDL copied to clipboard
[SDL2] Xbox Controller D-Pad and rumble work on PC but not on Android
I am using SDL_GameControllerGetButton to get D-Pad state. On Android, it always returns 0 even when some D-Pad button is pressed, while working fine on PC. Gamepad rumble is also broken on Android but not on PC. I am using SDL 2.30.2 and Xbox Series controller. Here is my gamepad handling code if it will help: link.
Android only supports rumble via a wired gamepad connection, at least for Android 12 and Android 13. There are reports that Bluetooth rumble may work with an Xbox One controller connected via Bluetooth on Android 14.
The D-pad works fine here, and I confirmed that Bluetooth Xbox controllers don't have rumble on Android 14.
Can you try this APK and see if it works for you? It's built using the latest SDL3 code in main. https://www.libsdl.org/tmp/testcontroller.apk
It fails to install as it days it's incompatible with my device. I have Pixel 7 Pro.
I have just tested it with my game which is using recent (around a week old) SDL3 snapshot, and it still doesn't work, but maybe the problems are with my code.
I've updated the APK, try again?
It works fine, looks like the problems are with my code.