Integrate Android Frame Pacing into your Vulkan renderer

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.

Get started

  1. Clone the games-samples repository.
  2. Follow the instructions in the prerequisites section of the AGDKTunnel README.
  3. Run the AGDKTunnel sample in Android Studio. This example project integrates Android Frame Pacing into a game that uses Vulkan for rendering.

    1. Open Android Studio.
    2. Click Project > Open and select the /games-samples/agdk/agdktunnel directory.
    3. Wait for Android Studio to sync the project.
    4. Connect a device or create a virtual device to run the sample (for more information, see Build and run your app).
    5. Select the target device and click Run Android Studio Run button.
    6. 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).