Integrate Android Frame Pacing into your OpenGL renderer
Stay organized with collections
Save and categorize content based on your preferences.
This tutorial describes how to integrate Android Frame Pacing into your
toolchain, how to use the functions that the library provides, and how to verify
that your frame pacing has improved. Android Frame Pacing is available as a
static or shared library in the AGDK Libraries.
Run the AGDKTunnel sample in Android Studio. This example
project integrates Android Frame Pacing into a game that uses OpenGL ES for
rendering.
Open Android Studio.
Click Projects > Open and select the
/games-samples/agdk/agdktunnel directory.
Wait for Android Studio to sync the project.
Connect a device or create a virtual device to run the sample (for more
information, see Build and run your app).
Select the target device and click Run.
The sample APK should build and install on the target device. If you
encounter errors, check the following:
You have a supported version
of the Android SDK; see the compileSdkVersion field in the app
module build.gradle file for more information. You can
update the SDK version from the
SDK Platforms tab in the SDK Manager.
You have a supported version
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
from the SDK Tools tab in the SDK Manager.
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.
After any build setting change, clean the project (Build > Clean
Project) and refresh the linked C++ projects (Build > Refresh
Linked C++ Projects).
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-08-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 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 OpenGL ES for\n rendering.\n\n 1. Open Android Studio.\n 2. Click **Projects \\\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**)."]]