Integrate Android Frame Pacing into your OpenGL 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. Download the SDK .zip file or clone the repository from the Android Open Source Project.
  2. Run the Bouncyball sample in Android Studio. This example project integrates Android Frame Pacing into a game that uses OpenGL ES for rendering.

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