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](https://github.com/android/games-samples.git).
2. Follow the instructions in the [prerequisites section of the AGDKTunnel README](https://github.com/android/games-samples/tree/main/agdk/agdktunnel#prerequisites).
3. Run the [AGDKTunnel sample](https://github.com/android/games-samples/tree/main/agdk/agdktunnel) 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](https://developer.android.com/studio/run)).
   5. Select the target device and click **Run** ![Android Studio Run button](https://developer.android.com/static/studio/images/buttons/toolbar-run.png).
   6. The sample APK should build and install on the target device. If you
      encounter errors, check the following:

      - You have a [supported version](https://developer.android.com/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](https://developer.android.com/studio/intro/update#sdk-manager) from the **SDK Platforms** tab in the SDK Manager.
      - You have a [supported version](https://developer.android.com/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](https://developer.android.com/studio/projects/install-ndk#specific-version) 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**).