تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تتيح لك وحدات الميزات فصل بعض الميزات والموارد.
من الوحدة الأساسية في تطبيقك وتضمينها في حِزمة التطبيق. يمكنك
ثم تخصيص خيارات التسليم
للتحكّم في وقت وطريقة الأجهزة التي تعمل بالإصدار 5.0 من نظام التشغيل Android (المستوى 21 من واجهة برمجة التطبيقات) أو الإصدارات الأحدث
تنزيل ميزات تطبيقك.
يُرجى العِلم أنّ هذا النوع من التقسيم إلى وحدات يتطلّب المزيد من الجهد وقد يتطلّب
بإعادة هيكلة التعليمات البرمجية الحالية لتطبيقك، لذا فكّر بعناية في أي من
الاستفادة القصوى من ميزات التطبيق من التوافر للمستخدمين عند الطلب.
إذا أردت تقسيم ميزات التطبيق تدريجيًا إلى وحدات مع مرور الوقت، بدون
تغيير سلوك التطبيق أو تخصيص خيارات التسليم المتقدمة،
إجراء ذلك من خلال إنشاء وحدات ميزات يتم ضبطها لتناسب وقت التثبيت
التسليم. بمعنى أنه يمكنك تقسيم العنصر إلى وحدات كوحدة خاصة، ولكن لا يمكن
تمكين الخيارات المتقدمة لكي تكون الميزة متوفرة عندما يثبّت أحد المستخدمين
التطبيق.
بالإضافة إلى ذلك، يمكن إلغاء تثبيت وحدات الميزات التي تم ضبطها للعرض في وقت التثبيت لاحقًا إذا لم تعُد هناك حاجة إليها. لتنفيذ ذلك، يجب إعداد هذه الملفات كقابلة للإزالة.
يوضّح هذا القسم كيفية إنشاء وحدة ميزات لوقت التثبيت.
التسليم. قبل أن تبدأ، تأكد من
باستخدام الإصدار 3.5 من "استوديو Android" أو الإصدارات الأحدث والإصدار 3.5.0 من المكوّن الإضافي لنظام Gradle المتوافق مع Android
أو أعلى.
إعداد وحدة جديدة للتسليم في وقت التثبيت
تتمثل أسهل طريقة لإنشاء وحدة ميزات جديدة في استخدام
الإصدار 3.5 من "استوديو Android" أو إصدار أحدث
لأنّ وحدات الميزات
على وحدة التطبيق الأساسية، يمكنك إضافتها فقط إلى الوحدات
ومشروعات التطبيقات.
لإضافة وحدة ميزة إلى مشروع تطبيقك باستخدام "استوديو Android"، يُرجى اتّباع الخطوات التالية:
والمتابعة على النحو التالي:
افتح مشروع تطبيقك في بيئة التطوير المتكاملة (IDE) إذا لم يسبق لك إجراء ذلك.
حدد ملف > جديد > وحدة جديدة من شريط القوائم.
في مربّع الحوار إنشاء وحدة جديدة، اختَر
وحدة الميزات الديناميكية وانقر على التالي.
في قسم تهيئة الوحدة الجديدة، أكمل
التالي:
اختَر وحدة التطبيق الأساسية لمشروع تطبيقك من.
القائمة المنسدلة.
حدِّد اسم الوحدة. يستخدم IDE هذا الاسم لتحديد
باعتبارها مشروعًا فرعيًا من Gradle في
ملف إعدادات Gradle عندما تريد
إنشاء حزمة تطبيقك، فإن Gradle يستخدم العنصر الأخير من المشروع الفرعي
لإدخال السمة <manifest split> في
بيان وحدة الميزات.
حدِّد اسم الحزمة للوحدة. "استوديو Android" بشكل تلقائي
اسم حزمة يضم اسم الحزمة الجذر
الوحدة الأساسية واسم الوحدة الذي حددته في الخطوة السابقة.
اختَر الحد الأدنى لمستوى واجهة برمجة التطبيقات الذي تريد أن تتيحه الوحدة.
يجب أن تتطابق هذه القيمة مع قيمة الوحدة الأساسية.
انقر على التالي.
في قسم خيارات تنزيل الوحدة، أكمل ما يلي:
حدِّد عنوان الوحدة باستخدام ما يصل إلى 50 حرفًا. قاعدة تطبيقك
عنوان الوحدة باعتباره
مورد السلسلة، والذي
الترجمة. عند إنشاء الوحدة باستخدام "استوديو Android"، يتمكن بيئة التطوير المتكاملة (IDE) من
تضيف مورد السلسلة إلى الوحدة الأساسية من أجلك وتُدخل
الإدخال التالي في بيان وحدة الميزات:
إذا أردت معرفة كيفية إنشاء وحدة من الميزات
التي يمكنك تنزيلها بعد تثبيت التطبيق، يمكنك قراءة
ضبط التسليم عند الطلب
ضع علامة في المربّع بجانب دمج إذا كنت تريد إتاحة هذه الوحدة.
للأجهزة التي تعمل بنظام التشغيل Android 4.4 (المستوى 20 لواجهة برمجة التطبيقات) والإصدارات الأقدم والمضمّنة في
حِزم APK متعددة. يعني ذلك أنّه يمكنك حذف البيانات من الأجهزة غير المتوافقة.
تنزيل حِزم APK مجزّأة وتثبيتها يضيف "استوديو Android"
التالية في بيان الوحدة ليعكس اختيارك:
بعد انتهاء "استوديو Android" من إنشاء الوحدة، افحص محتوياتها
بنفسك من جزء المشروع (اختَر عرض > نوافذ الأدوات > المشروع
من شريط القوائم). يجب أن يكون الرمز الافتراضي والموارد والمؤسسة
المشابهة لتلك الخاصة بوحدة التطبيق القياسية.
جعل وحدة وقت التثبيت قابلة للإزالة
قد يكون من المفيد إنشاء وحدات ميزات للعرض في وقت التثبيت مع توفير خيار إلغاء التثبيت لاحقًا إذا لم يعد هناك حاجة إليه. على سبيل المثال، لتقليل حجم
يمكنك تقسيم المحتوى
المطلوب للتدريب أو الإعداد إلى وحدات
بعد ذلك
إلغاء تثبيت وحدة الميزات باستخدام Play Core API
بعد إعداد المستخدم لاستخدام تطبيقك.
لا يمكن إزالة وحدات وقت التثبيت تلقائيًا. لوضع علامة على وحدة تشير إلى أنّها قابلة للإزالة والسماح بإلغاء تثبيتها، أضِف العلامة removable واضبط قيمتها على true:
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Configure install-time delivery\n\nFeature modules allow you to separate certain features and resources\nfrom the base module of your app and include them in your app bundle. You can\nthen [customize delivery options](/guide/playcore/feature-delivery#customize_delivery)\nto control when and how devices running Android 5.0 (API level 21) or higher\ndownload your app's features.\n\nKeep in mind, this type of modularization requires more effort and possibly\nrefactoring your app's existing code, so consider carefully which of your\napp's features would benefit the most from being available to users on demand.\n\nIf you want to gradually modularize app features over time, without\nchanging the behavior of your app or customizing advanced delivery options, you\ncan do so by creating feature modules that are configured for install-time\ndelivery. That is, you can modularize a feature as a feature module, but not\nenable advanced options so the feature is available when a user installs your\napp.\n\nAdditionally, feature modules that are configured for install-time delivery have the option to later be uninstalled if they're no longer required. For that, they need to be [set up as removable](#make-removable).\n\nThis section describes how to create a feature module for install-time\ndelivery. Before you begin, make sure you're\nusing [Android Studio 3.5](/studio) or higher and Android Gradle Plugin 3.5.0\nor higher.\n\nConfigure a new module for install-time delivery\n------------------------------------------------\n\nThe easiest way to create a new feature module is by using\n[Android Studio 3.5](/studio) or higher.\nBecause feature modules have an\ninherent dependency on the base app module, you can add them only to existing\napp projects.\n\nTo add a feature module to your app project using Android Studio,\nproceed as follows:\n\n1. If you haven't already done so, open your app project in the IDE.\n2. Select **File \\\u003e New \\\u003e New Module** from the menu bar.\n3. In the **Create New Module** dialog, select **Dynamic Feature Module** and click **Next**.\n4. In the **Configure your new module** section, complete the following:\n 1. Select the **Base application module** for your app project from the dropdown menu.\n 2. Specify a **Module name** . The IDE uses this name to identify the module as a Gradle subproject in your [Gradle settings file](/studio/build#settings-file). When you build your app bundle, Gradle uses the last element of the subproject name to inject the `\u003cmanifest split\u003e` attribute in the [feature module's manifest](/guide/app-bundle/dynamic-delivery#dynamic_feature_manifest).\n 3. Specify the module's **package name**. By default, Android Studio suggests a package name that combines the root package name of the base module and the module name you specified in the previous step.\n 4. Select the **Minimum API level** you want the module to support. This value should match that of the base module.\n5. Click **Next**.\n6. In the **Module Download Options** section, complete the following:\n\n 1. Specify the **Module title** using up to 50 characters. Your app's base\n module must include the module title as a\n [string resource](/guide/topics/resources/string-resource), which you\n can translate. When creating the module using Android Studio, the IDE\n adds the string resource to the base module for you and injects the\n following entry in the feature module's manifest:\n\n \u003cdist:module\n ...\n dist:title=\"@string/feature_title\"\u003e\n \u003c/dist:module\u003e\n\n | **Note:** If you enable resource shrinking, such as for your release builds, the shrinker might remove the module title string resource if code in your base module does not reference it. To make sure the string resource remains in the build output, include the resource in a [custom resource keep file](/studio/build/shrink-code#keep-resources).\n 2. In the dropdown menu under **Install-time inclusion** , select **Include\n module at install-time**. Android Studio injects the following in the\n module's manifest to reflect your choice:\n\n \u003cdist:module ... \u003e\n \u003cdist:delivery\u003e\n \u003cdist:install-time /\u003e\n \u003c/dist:delivery\u003e\n \u003c/dist:module\u003e\n\n If you want to learn how to create a feature module\n that you can download after app install, read\n [configure on-demand delivery](/studio/projects/dynamic-delivery/on-demand-delivery).\n 3. Check the box next to **Fusing** if you want this module to be available\n to devices running Android 4.4 (API level 20) and lower and included in\n multi-APKs. That means you can omit it from devices that don't support\n downloading and installing split APKs. Android Studio injects the\n following in the module's manifest to reflect your choice:\n\n \u003cdist:module ...\u003e\n \u003cdist:fusing dist:include=\"true | false\" /\u003e\n \u003c/dist:module\u003e\n\n7. Click **Finish**.\n\nAfter Android Studio finishes creating your module, inspect its contents\nyourself from the **Project** pane (select **View \\\u003e Tool Windows \\\u003e Project**\nfrom the menu bar). The default code, resources, and organization should be\nsimilar to those of the standard app module.\n\nMake an install-time module removable\n-------------------------------------\n\nIt might be useful to create feature modules for install-time delivery that have the option to be later uninstalled if no longer required. For example, to reduce the installed size of\nyour app, you can modularize content that's required for training or onboarding,\nand then\n[uninstall the feature module](/guide/playcore/feature-delivery/on-demand#uninstall_modules) using the Play Core API\nafter the user is set up to use your app.\n\nInstall-time modules are not removable by default. To mark a module as removable and allow it to be uninstalled, add the `removable` tag and set its value to `true`: \n\n \u003cdist:module ... \u003e\n \u003cdist:delivery\u003e\n \u003cdist:install-time\u003e\n \u003cdist:removable dist:value=\"true\"/\u003e\n \u003c/dist:install-time\u003e\n \u003c/dist:delivery\u003e\n \u003c/dist:module\u003e\n\n| **Note:** Configuring too many install-time modules as removable might increase the download and install time for your app. To avoid this issue, keep the number of removable install-time delivery modules under 10."]]