<uses-library>
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
ملاحظة: يستخدم Google Play العناصر <uses-library>
التي تم تعريفها
في بيان التطبيق لفلترة تطبيقك من الأجهزة التي لا تتوافق
متطلبات المكتبة. لمزيد من المعلومات عن الفلترة، يُرجى الاطّلاع على
الفلاتر على Google Play:
- بناء الجملة:
-
<uses-library
android:name="string"
android:required=["true" | "false"] />
- الواردة في:
-
<application>
- description:
-
تحدِّد هذه السياسة مكتبة مشتركة يجب ربط التطبيق بها.
يخبر هذا العنصر النظام بتضمين رمز المكتبة في الفئة
للحزمة.
كل حزم android
، مثل android.app
،
android.content
وandroid.view
وandroid.widget
في المكتبة التلقائية حيث يتم ربط جميع التطبيقات تلقائيًا
ضد. في المقابل، تتضمّن بعض الحِزم، مثل maps
،
في مكتبات منفصلة لا يتم ربطها تلقائيًا. الرجوع إلى
وثائق للحزم التي تستخدمها لتحديد المكتبة
يحتوي على رمز الحزمة.
إنّ ترتيب علامات <uses-library>
مهم. يؤثر في البحث عن الصف
وترتيبها عند تحميل التطبيق. قد تحتوي بعض المكتبات على
تكرار الصفوف، وفي هذه الحالة تكون الأولوية للمكتبة التي تأتي أولاً.
كما يؤثر هذا العنصر في تثبيت التطبيق على جهاز معين
مدى توفر التطبيق على Google Play. إذا كان هذا العنصر موجودًا وكان هذا العنصر
تم ضبط سمة android:required
على "true"
، وهي قيمة
PackageManager
لن يتيح للمستخدم تثبيت التطبيق ما لم تكن المكتبة متاحة على
جهاز المستخدم.
يمكن الاطّلاع على السمة android:required
بالتفصيل في القسم التالي.
- :
-
android:name
-
تمثّل هذه السمة اسم المكتبة. يتم توفير الاسم بواسطة
وثائق للحزمة التي تستخدمها. مثال على ذلك
"android.test.runner"
، حزمة تتضمّن اختبار Android
الصفوف.
android:required
-
قيمة منطقية تشير إلى ما إذا كان التطبيق يتطلب
المكتبة المحددة بواسطة
android:name
.
والقيمة التلقائية هي "true"
.
تم طرح هذا الإصدار في المستوى 7 من واجهة برمجة التطبيقات.
- تم تقديمها في:
- مستوى واجهة برمجة التطبيقات 1
- راجِع أيضًا:
-
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ 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,["# <uses-library\u003e\n\n**Note:** Google Play uses the `\u003cuses-library\u003e` elements declared\nin your app manifest to filter your app from devices that don't meet its\nlibrary requirements. For more information about filtering, see\n[Filters on Google Play](/google/play/filters).\n\nsyntax:\n:\n\n ```xml\n \u003cuses-library\n android:name=\"string\"\n android:required=[\"true\" | \"false\"] /\u003e\n ```\n\ncontained in:\n:\n `\n `[\u003capplication\u003e](/guide/topics/manifest/application-element)`\n `\n\ndescription:\n\n:\n Specifies a shared library that the application must be linked against.\n This element tells the system to include the library's code in the class\n loader for the package.\n\n\n All the `android` packages, such as [android.app](/reference/android/app/package-summary),\n [android.content](/reference/android/content/package-summary), [android.view](/reference/android/view/package-summary), and [android.widget](/reference/android/widget/package-summary),\n are in the default library that all applications are automatically linked\n against. However, some packages, such as `maps`, are\n in separate libraries that aren't automatically linked. Consult the\n documentation for the packages you're using to determine which library\n contains the package code.\n\n\n The order of `\u003cuses-library\u003e` tags is significant. It affects class lookup\n and resolution order when the application loads. Some of the libraries might have\n duplicate classes, and in that case the library that comes first takes priority.\n\n\n This element also affects the installation of the application on a particular device and\n the availability of the application on Google Play. If this element is present and its\n `android:required` attribute is set to `\"true\"`, the\n [PackageManager](/reference/android/content/pm/PackageManager)\n framework won't let a user install the application unless the library is present on the\n user's device.\n\n\n The `android:required` attribute is described in detail in the following section.\n\nattributes:\n:\n\n `android:name`\n :\n The name of the library. The name is provided by the\n documentation for the package you are using. An example of this is\n `\"android.test.runner\"`, a package that contains Android test\n classes.\n\n `android:required`\n :\n Boolean value that indicates whether the application requires the\n library specified by `android:name`.\n\n - `\"true\"`: the application doesn't function without this library. The system doesn't let the application install on a device that doesn't have the library.\n - `\"false\"`: the application uses the library if present, but is designed to function without it if necessary. The system lets the application install, even if the library isn't present. If you use `\"false\"`, you are responsible for checking at runtime that the library is available.\n\n\n To check for a library, you can use reflection to determine\n whether a particular class is available.\n\n\n The default is `\"true\"`.\n\n Introduced in: API level 7.\n\n\nintroduced in:\n: API Level 1\n\nsee also:\n:\n - [PackageManager](/reference/android/content/pm/PackageManager)"]]