نمونه وضعیت حرارتی دستگاه را با استفاده از ADPF getThermalHeadroom API و API وضعیت حرارتی نمایش می دهد. این برنامه همچنین به صورت پویا حجم کار را بر اساس Thermal headroom و Performance Hint Manager API تغییر می دهد تا عملکرد رندر رشته را کنترل کند.
Codelab
ادغام ویژگیهای سازگاری در نرمافزار C++ بازی شما را راهنمایی میکند تا ویژگیهای ADPF را با مراحل سادهای که میتوانید با سرعت خودتان دنبال کنید، در بازی خود ادغام کنید. در پایان نرم افزار کد، ویژگی های زیر را یکپارچه خواهید کرد و عملکرد آنها را بهتر درک خواهید کرد:
API حرارتی : به وضعیت حرارتی دستگاه گوش دهید و قبل از اینکه دستگاه در حالت گلوگاه حرارتی قرار گیرد واکنش نشان دهید.
Game Mode API : ترجیحات بهینه سازی بازیکن را درک کنید (به حداکثر رساندن عملکرد یا حفظ باتری) و بر اساس آن تنظیم کنید.
Game State API : به سیستم اجازه دهید از وضعیت بازی شما (بارگیری، بازی، رابط کاربری و غیره) مطلع شود و سیستم می تواند منابع را بر اساس آن تنظیم کند (I/O یا CPU، GPU و غیره).
Performance Hint API : به سیستم اجازه دهید مدل رشته و حجم کاری شما را بداند تا سیستم بتواند منابع را بر اساس آن تخصیص دهد.
شکل 2. ADPF Codelab Infographic
داستان های توسعه دهندگان
بررسی کنید که چگونه توسعهدهندگان بازی ثبات FPS خود را افزایش داده و مصرف انرژی خود را با استفاده از APIهای سازگاری در این داستانهای موفقیت توسعهدهنده بهینه میکنند!
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی."],[],[],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)"]]