Figure 1. Application de jeu de démonstration ADPF
L'exemple affiche l'état thermique de l'appareil à l'aide de l'API getThermalHeadroom ADPF et de l'API état thermique. L'application modifie également la charge de travail de manière dynamique en fonction de la marge thermique et de l'API Performance Hint Manager afin de contrôler les performances du thread de rendu.
Atelier de programmation
L'atelier de programmation Integrating Adaptability Features Into Your C++ Game (Intégrer des fonctionnalités d'adaptabilité dans votre jeu C++) vous explique comment intégrer les fonctionnalités ADPF à votre jeu en suivant des étapes simples que vous pouvez suivre à votre rythme. À la fin de cet atelier de programmation, vous aurez intégré les fonctionnalités suivantes et vous comprendrez mieux leurs fonctionnalités:
API Thermal: écoutez l'état thermique de l'appareil et réagissez avant qu'il ne passe en mode de limitation thermique.
API Game Mode: identifiez les préférences d'optimisation du joueur (maximiser les performances ou préserver la batterie) et ajustez en conséquence.
API Game State: indiquez au système l'état de votre jeu (chargement, lecture, UI, etc.). Le système peut alors ajuster les ressources en conséquence (booster les E/S, ou le processeur, le GPU, etc.).
API Performance Hint: indiquez au système votre modèle de thread et votre charge de travail afin qu'il puisse allouer les ressources en conséquence.
Figure 2 : infographie de l'atelier de programmation ADPF
Témoignages de développeurs
Découvrez comment les développeurs de jeux ont amélioré la stabilité de leurs FPS et optimisé leur consommation d'énergie à l'aide des API Adaptability dans ces histoires de réussite de développeurs.
Le contenu et les exemples de code de cette page sont soumis aux licences décrites dans la Licence de contenu. Java et OpenJDK sont des marques ou des marques déposées d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/26 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/07/26 (UTC)."],[],[],null,["# Sample, Codelab and Developer Stories\n\nSample App\n----------\n\nThe [ADPF sample app](https://github.com/android/games-samples/tree/main/agdk/adpf)\ndemonstrates the basic use of the ADPF API.\n**Figure 1.** ADPF Demo Game Application\n\nThe sample displays the device's thermal status using the ADPF\n[`getThermalHeadroom`](/reference/android/os/PowerManager#getThermalHeadroom(int))\nAPI and the [thermal status](/reference/android/os/PowerManager.OnThermalStatusChangedListener)\nAPI. The app also dynamically changes the workload based on the Thermal headroom\nand the [Performance Hint Manager API](/reference/android/os/PerformanceHintManager)\nto control render thread performance.\n\nCodelab\n-------\n\nThe [Integrating Adaptability Features Into Your C++ Game](/adaptability-codelab)\ncodelab guides you to integrate ADPF features into your game with simple steps\nthat you can follow at your own pace. At the end of the codelab, you will have\nintegrated the following features and will better understand their\nfunctionalities:\n\n- [Thermal API](/games/optimize/adpf#thermal): listen to device thermal condition and react before the device falls into thermal throttling state.\n- [Game Mode API](/games/optimize/adpf/gamemode/about-API-and-interventions): understand player's optimization preference (maximize performance or preserving battery) and adjust accordingly.\n- [Game State API](/reference/android/app/GameState): let the system know the state of your game (loading, playing, UI, etc) and the system can adjust resources accordingly (boost I/O, or CPU, GPU, etc).\n- [Performance Hint API](/reference/android/os/PerformanceHintManager): let the system know your threading model and workload so that the system can allocate resources accordingly.\n\n**Figure 2.**ADPF Codelab Infographic\n\nDeveloper Stories\n-----------------\n\nCheck out how game developers increased their FPS stability and optimize their\npower consumption using Adaptability APIs in these developer success stories!\n\n- [Kakao Games increased FPS stability to 96% through Android Adaptability](/stories/games/kakaogames-adaptability)\n- [Gameloft reduces device power consumption by 70%, resulting in 35% longer play time with the Game Mode API](/stories/games/gameloft-gamemode)\n- [Android Game Development Kit (AGDK) update: Adaptability and performance features](https://www.youtube.com/watch?v=_-FwUrQAsVg)\n- [GDC Vault - Google Developer Summit: Improving Game Performance with Android Dynamic Performance Framework](https://www.gdcvault.com/play/1029174/Google-Developer-Summit-Improving-Game)\n- [MediaTek enhances dynamic performance of Android SoCs](/stories/games/mediatek-adpf)\n- [NCSoft Lineage W improves sustained performance and prevents thermal throttling by using ADPF](/stories/games/lineagew-adpf)\n- [ARM getting started with Android Dynamic Performance Framework (ADPF) in Unreal Engine](/stories/games/arm-adpf)\n- [Netmarble Games: Optimizing Performance with ADPF](/stories/games/netmarble-got-adpf)"]]