Android Games samples
A selection of code samples to accelerate your game development.
Game samples
Android Games Development Kit (AGDK)
Review a game based on the NDK Endless Tunnel sample, a sample that shows the Game Controller library using the GameActivity library, and a sample that shows the Game Controller library using the NativeActivity library. Useful for visualizing how a paired controller interacts on your device.
AGDK Tunnel in C++
Sample game in C++ utilizing AGDK libraries: Android Performance Tuner, Frame Pacing, GameActivity, GameController, GameTextInput and Oboe Audio. Optionally, you can also enable these Play libraries: Play Games Services, Asset Delivery and Input SDK.
Android Game Development Extension (AGDE)
Review a sample that uses linked assembly, a minimal Hello World JNI example, and an example of a multiplatform project with build targets for both Android and Microsoft Windows.
Android Device Performance Framework (ADPF)
Review a sample app that displays the device's thermal status using the getThermalHeadroom API and the thermal state monitoring API. The app also dynamically changes the workload based on the API's hint, and uses the PerformanceHintManager API to control render thread performance.
Game Mode API
Review a sample app that highlights how to optimize FPS and render resolution caps to save 25% power in your apps.
Power efficiency sample for Unity
Review a sample project that highlights best practices for power efficiency when running Unity engine games on Android devices.
Trivial Kart on Unity and Godot
Sample game on Unity and Godot to demonstrate in-app purchases, Play Games Services, Play Integrity API and Input SDK.
Plugins
Google Play Games Unity
Automate routines for Google Play Games development with Unity.
Vulkan Quality plugin on Unity
The Vulkan Quality (VkQuality) plugin for the Unity engine provides launch-time recommendations of the graphics API—Vulkan or OpenGL ES—to use for your game on specific devices.
ADPF plugin on Unreal
The ADPF Unreal plugin has two main functions: (1) Monitor device thermals and adjusts performance to prevent overheating. (2) Utilize Performance Hints to allocate workloads to the correct CPU cores.
Unity ANR plugin
The Unity ANR plugin helps you diagnose ANRs in your game running on Unity 2022 and older.