Integrazione del pacing dei frame Android nel renderer OpenGL
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questo tutorial descrive come integrare Android Frame Pacing nella toolchain, come utilizzare le funzioni fornite dalla libreria e come verificare che il frame pacing sia migliorato. Android Frame Pacing è disponibile come
libreria statica o condivisa nelle librerie AGDK.
Inizia
- Clona il repository
games-samples
.
- Segui le istruzioni nella sezione dei prerequisiti del file README di AGDKTunnel.
Esegui l'esempio AGDKTunnel in Android Studio. Questo progetto di esempio
integra Android Frame Pacing in un gioco che utilizza OpenGL ES per
il rendering.
- Apri Android Studio.
- Fai clic su Progetti > Apri e seleziona la directory
/games-samples/agdk/agdktunnel
.
- Attendi che Android Studio sincronizzi il progetto.
- Collega un dispositivo o crea un dispositivo virtuale per eseguire l'esempio (per ulteriori
informazioni, vedi Crea ed esegui l'app).
- Seleziona il dispositivo di destinazione e fai clic su Esegui
.
L'APK di esempio deve essere compilato e installato sul dispositivo di destinazione. Se
si verificano errori, controlla quanto segue:
- Hai una versione supportata
dell'SDK Android. Per saperne di più, consulta il campo
compileSdkVersion
nel file build.gradle
del modulo dell'app. Puoi
aggiornare la versione dell'SDK dalla scheda
Piattaforme SDK in SDK Manager.
- Hai una versione supportata
dell'NDK Android. Per maggiori informazioni, consulta il campo
ndkVersion
nel file
build.gradle
del modulo dell'app. Puoi
installare una versione specifica dell'NDK
dalla scheda Strumenti SDK in SDK Manager.
- Il file
local.properties
nel progetto non ha una voce
per ndk.dir
. Questa posizione è specificata da Android Studio e utilizza
la versione NDK indicata sopra. Se hai questa voce, cancella l'intera
riga.
- Dopo aver modificato qualsiasi impostazione di build, pulisci il progetto (Build > Clean
Project) e aggiorna i progetti C++ collegati (Build > Refresh
Linked C++ Projects).
I campioni di contenuti e codice in questa pagina sono soggetti alle licenze descritte nella Licenza per i contenuti. Java e OpenJDK sono marchi o marchi registrati di Oracle e/o delle sue società consociate.
Ultimo aggiornamento 2025-08-26 UTC.
[null,null,["Ultimo aggiornamento 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**)."]]