Android has supported a wide array of game controllers since API level 9 (Android 2.3 Gingerbread). Modern Android versions accommodate many popular gamepads and their advanced functionalities such as:
- Classic and advanced inputs
- Local multiplayer with multiple gamepad support
- Touchpad support
- Haptics
- Lightbar control
- Accelerometer
To facilitate the most common use cases today, Android has a standard definition for gamepad mappings to simplify the amount of testing a developer has to perform while also preserving what makes each type of gamepad unique.
Your game engine may already support controller input for Android today, and we recommend starting there as you look to implement controller support in your game. If your game engine doesn't support controller input, or only supports basic features and you would like to take advantage of advanced features, you can use the following libraries to implement support directly into your game with our Android APIs:
- For C++ developers using NativeActivity or GameActivity, it is recommended to use the Game Controller Library. This library, a component of the Android Game Developer's Toolkit, offers a C/C++ API comparable to other platforms. It also provides straightforward access to haptics and advanced motion events, along with a mechanism for detecting gamepad layouts and labels, enabling games to display accurate button prompts.
- For Java and Kotlin developers using the native Android APIs, this guide describes how to handle controller actions across the most common game controllers, support multiple game controllers to enable local "couch" multiplayer, and enable advanced controller features such as haptics, touchpads, and inertial measurement units (gyroscopes and accelerometers).
Regardless of how you implement controller support for your game, we recommend following our testing guidance to ensure a consistent and high-quality experience for your users across Android devices. We also recommend reviewing how controller-supported games are displayed in the Google Play Store, which includes instructions on how to make sure your game is correctly labeled as having controller support.
Multi-form factor
Android's broad compatibility with diverse device form factors extends to game controllers, allowing you to elevate your gaming experience whether you're playing on a mobile phone, a large screen tablet or even through a TV. Large screens and Android TV devices are perfect for a console-like experience in the comfort of your living room, offering rich visuals and the ability to play more graphically intensive games. This cross-device compatibility not only enhances gameplay but also broadens your choices, ensuring that the best gaming experiences are accessible on any Android-powered device.
For more information, see the following related resources: