دمج ميزة "معدل سرعة الإطارات" في Android في عارض OpenGL
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يوضّح هذا البرنامج التعليمي كيفية دمج Frame Pacing API في سلسلة أدواتك، وكيفية استخدام الدوال التي توفّرها المكتبة، وكيفية التأكّد من تحسُّن معدّل عرض اللقطات. تتوفّر أداة "مزامنة عرض اللقطات على Android" كمكتبة ثابتة أو مشتركة في "مكتبات AGDK".
شغِّل نموذج AGDKTunnel في "استوديو Android". يدمج مشروع المثال هذا أداة Android Frame Pacing في لعبة تستخدم OpenGL ES للعرض.
افتح "استوديو Android".
انقر على المشاريع > فتح واختَر دليل /games-samples/agdk/agdktunnel.
انتظِر إلى أن يزامن "استوديو Android" المشروع.
اربط جهازًا أو أنشئ جهازًا افتراضيًا لتشغيل العيّنة (لمزيد من المعلومات، راجِع إنشاء تطبيقك وتشغيله).
اختَر الجهاز المستهدف وانقر على تشغيل.
يجب إنشاء ملف APK للعيّنة وتثبيته على الجهاز المستهدف. في حال ظهور أخطاء، تحقَّق مما يلي:
يجب أن يكون لديك إصدار متوافق
من حزمة تطوير البرامج (SDK) لنظام التشغيل Android. يمكنك الاطّلاع على الحقل compileSdkVersion في ملف build.gradle لوحدة تطبيقك للحصول على مزيد من المعلومات. يمكنك
تحديث إصدار حزمة تطوير البرامج (SDK) من علامة التبويب
منصات حزمة تطوير البرامج (SDK) في "أداة إدارة حزمة تطوير البرامج (SDK)".
يجب أن يكون لديك إصدار متوافق من حزمة تطوير البرامج (NDK) لنظام Android. راجِع الحقل ndkVersion في ملف build.gradle لوحدة التطبيق للحصول على مزيد من المعلومات. يمكنك
تثبيت إصدار معيّن من NDK
من علامة التبويب أدوات حزمة تطوير البرامج (SDK) في "مدير حزمة تطوير البرامج (SDK)".
لا يحتوي الملف local.properties في المشروع على إدخال
لـ ndk.dir. يتم تحديد هذا الموقع الجغرافي من خلال "استوديو Android" ويستخدم إصدار NDK المذكور أعلاه. إذا كان لديك هذا الإدخال، عليك محو السطر بأكمله.
بعد إجراء أي تغيير على إعدادات الإصدار، عليك تنظيف المشروع (إنشاء > تنظيف المشروع) وإعادة تحميل مشاريع C++ المرتبطة (إنشاء > إعادة تحميل مشاريع C++ المرتبطة).
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-08-26 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-08-26 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],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**)."]]