### Android Games samples

A selection of code samples to accelerate your game development.

## Game samples

[![](http://developer.android.com/static/images/games/agdk.png)](https://github.com/android/games-samples/tree/main/agdk)  

### [Android Games Development Kit (AGDK)](https://github.com/android/games-samples/tree/main/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.  
[Go to GitHub](https://github.com/android/games-samples/tree/main/agdk)[![](http://developer.android.com/static/images/games/agdk-tunnel.png)](https://github.com/android/games-samples/tree/main/agdk/agdktunnel)  

### [AGDK Tunnel in C++](https://github.com/android/games-samples/tree/main/agdk/agdktunnel)

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.  
[Go to GitHub](https://github.com/android/games-samples/tree/main/agdk/agdktunnel)[![](http://developer.android.com/static/images/games/agde.png)](https://github.com/android/games-samples/tree/main/agdk/agde)  

### [Android Game Development Extension (AGDE)](https://github.com/android/games-samples/tree/main/agdk/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.  
[Go to GitHub](https://github.com/android/games-samples/tree/main/agdk/agde)[![](http://developer.android.com/static/images/games/adpf.png)](https://github.com/android/games-samples/tree/main/agdk/adpf)  

### [Android Device Performance Framework (ADPF)](https://github.com/android/games-samples/tree/main/agdk/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.  
[Go to GitHub](https://github.com/android/games-samples/tree/main/agdk/adpf)[![](http://developer.android.com/static/images/games/game-mode-api.png)](https://github.com/android/games-samples/tree/main/agdk/game_mode)  

### [Game Mode API](https://github.com/android/games-samples/tree/main/agdk/game_mode)

Review a sample app that highlights how to optimize FPS and render resolution caps to save 25% power in your apps.  
[Go to GitHub](https://github.com/android/games-samples/tree/main/agdk/game_mode)[![](http://developer.android.com/static/images/games/unity-power-sample.png)](https://github.com/android/games-samples/tree/main/unity/power_efficiency_demo)  

### [Power efficiency sample for Unity](https://github.com/android/games-samples/tree/main/unity/power_efficiency_demo)

Review a sample project that highlights best practices for power efficiency when running Unity engine games on Android devices.  
[Go to GitHub](https://github.com/android/games-samples/tree/main/unity/power_efficiency_demo)[![](http://developer.android.com/static/images/games/trivial-kart.png)](https://github.com/android/games-samples/tree/main/trivialkart/trivialkart-unity)  

### [Trivial Kart on Unity and Godot](https://github.com/android/games-samples/tree/main/trivialkart/trivialkart-unity)

Sample game on Unity and Godot to demonstrate in-app purchases, Play Games Services version 2.0 features, Play Integrity API and Input SDK.  
[Go to GitHub (Unity)](https://github.com/android/games-samples/tree/main/trivialkart/trivialkart-unity)[Go to GitHub (Godot)](https://github.com/android/games-samples/tree/main/trivialkart/trivialkart-godot)[![](http://developer.android.com/static/images/games/native-pc-sdk.png)](https://github.com/playgameservices/native-pc-sdk-sample)  

### [Google Play for native PC](https://github.com/playgameservices/native-pc-sdk-sample)

Sample projects demonstrating how to integrate Google Play APIs into your native game.  
[Go to GitHub](https://github.com/playgameservices/native-pc-sdk-sample)

## Plugins

[![](http://developer.android.com/static/images/games/google-play-games-unity.png)](https://github.com/android/games-samples/tree/main/googleplaygamesforpc/unity_projects/platform_utils_package)  

### [Google Play Games Unity](https://github.com/android/games-samples/tree/main/googleplaygamesforpc/unity_projects/platform_utils_package)

Automate routines for Google Play Games development with Unity.  
[Go to GitHub](https://github.com/android/games-samples/tree/main/googleplaygamesforpc/unity_projects/platform_utils_package)[![](http://developer.android.com/static/images/games/vulkan.svg)](https://github.com/android/vkquality)  

### [Vulkan Quality plugin on Unity](https://github.com/android/vkquality)

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.  
[Go to GitHub](https://github.com/android/vkquality)[![](http://developer.android.com/static/images/games/adpf-plugin.svg)](https://github.com/android/adpf-unreal-plugin)  

### [ADPF plugin on Unreal](https://github.com/android/adpf-unreal-plugin)

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.  
[Go to GitHub](https://github.com/android/adpf-unreal-plugin)[![](http://developer.android.com/static/images/games/unity-plugin.png)](https://github.com/android/games-samples/tree/main/unity/anr_plugin)  

### [Unity ANR plugin](https://github.com/android/games-samples/tree/main/unity/anr_plugin)

The Unity ANR plugin helps you diagnose ANRs in your game running on Unity 2022 and older.  
[Go to GitHub](https://github.com/android/games-samples/tree/main/unity/anr_plugin)