Интегрируйте Android Frame Pacing в ваш рендерер Vulkan
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
В этом руководстве описывается, как интегрировать Android Frame Pacing в ваш набор инструментов, как использовать функции библиотеки и как проверить, улучшилось ли качество вашего Frame Pacing. Android Frame Pacing доступен в виде статической или общей библиотеки в библиотеках AGDK.
Начать
- Клонируйте репозиторий
games-samples
. - Следуйте инструкциям в разделе предварительных требований файла README AGDKTunnel .
Запустите пример AGDKTunnel в Android Studio. Этот проект интегрирует Android Frame Pacing в игру, использующую Vulkan для рендеринга.
- Откройте Android Studio.
- Нажмите Проект > Открыть и выберите каталог
/games-samples/agdk/agdktunnel
. - Подождите, пока Android Studio синхронизирует проект.
- Подключите устройство или создайте виртуальное устройство для запуска образца (для получения дополнительной информации см. раздел Сборка и запуск приложения ).
- Выберите целевое устройство и нажмите «Запустить».
. Образец APK-файла должен быть собран и установлен на целевом устройстве. При возникновении ошибок проверьте следующее:
- У вас установлена поддерживаемая версия Android SDK; дополнительную информацию см. в поле
compileSdkVersion
в файле build.gradle
модуля приложения. Вы можете обновить версию SDK на вкладке «Платформы SDK» в диспетчере SDK. - У вас установлена поддерживаемая версия Android NDK; дополнительную информацию см. в поле
ndkVersion
в файле build.gradle
модуля приложения. Вы можете установить нужную версию NDK на вкладке «Инструменты SDK» в диспетчере SDK. - В файле
local.properties
проекта отсутствует запись для ndk.dir
. Это расположение указано Android Studio и использует версию NDK, указанную выше. Если эта запись есть, удалите всю строку. - После любого изменения настроек сборки очистите проект ( Сборка > Очистить проект ) и обновите связанные проекты C++ ( Сборка > Обновить связанные проекты C++ ).
Контент и образцы кода на этой странице предоставлены по лицензиям. Java и OpenJDK – это зарегистрированные товарные знаки корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-08-26 UTC.
[null,null,["Последнее обновление: 2025-08-26 UTC."],[],[],null,["This tutorial describes how to integrate Android Frame Pacing into your\ntoolchain, how to use the functions that the library provides, and how to verify\nthat your frame pacing has improved. Android Frame Pacing is available as a\nstatic or shared library in the AGDK Libraries.\n\nGet started\n\n1. Clone the [`games-samples` repository](https://github.com/android/games-samples.git).\n2. Follow the instructions in the [prerequisites section of the AGDKTunnel README](https://github.com/android/games-samples/tree/main/agdk/agdktunnel#prerequisites).\n3. Run the [AGDKTunnel sample](https://github.com/android/games-samples/tree/main/agdk/agdktunnel) in Android Studio. This example\n project integrates Android Frame Pacing into a game that uses Vulkan for\n rendering.\n\n 1. Open Android Studio.\n 2. Click **Project \\\u003e Open** and select the `/games-samples/agdk/agdktunnel` directory.\n 3. Wait for Android Studio to sync the project.\n 4. Connect a device or create a virtual device to run the sample (for more information, see [Build and run your app](/studio/run)).\n 5. Select the target device and click **Run** .\n 6. The sample APK should build and install on the target device. If you\n encounter errors, check the following:\n\n - You have a [supported version](/games/sdk#requirements) of the Android SDK; see the `compileSdkVersion` field in the app module `build.gradle` file for more information. You can [update the SDK version](/studio/intro/update#sdk-manager) from the **SDK Platforms** tab in the SDK Manager.\n - You have a [supported version](/games/sdk#requirements) of the Android NDK; see the `ndkVersion` field in the app module `build.gradle` file for more information. You can [install a specific version of the NDK](/studio/projects/install-ndk#specific-version) from the **SDK Tools** tab in the SDK Manager.\n - The `local.properties` file in the project does *not* have an entry for `ndk.dir`. This location is specified by Android Studio and uses the NDK version from above. If you have this entry, clear the entire line.\n - After any build setting change, clean the project (**Build \\\u003e Clean\n Project** ) and refresh the linked C++ projects (**Build \\\u003e Refresh\n Linked C++ Projects**)."]]