Google Mobile Ads Lite SDK، Google Mobile Ads Lite SDK
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
مانند هر کتابخانه اندرویدی، Google Play Services SDK اندازه برنامه هایی را که شامل آن می شود افزایش می دهد. Google Mobile Ads Lite SDK نسخه سبک وزن Google Mobile Ads SDK است که برای کاهش این تأثیر ساخته شده است. این کسری از اندازه SDK معمولی است.
در کنار کاهش اندازه، استفاده از Lite SDK تعداد کل روشهای ارجاعشده در یک برنامه را کاهش میدهد. این به ویژه در هنگام استقرار در نسخههای قدیمیتر اندروید، جایی که توسعهدهندگان میتوانند با محدودیت مرجع 64K اجرا شوند، مفید است.
در اینجا نحوه پیکربندی gradle برای گنجاندن Lite SDK در برنامه شما آمده است:
Lite SDK فقط باید در برنامههای توزیع شده از طریق فروشگاه Google Play استفاده شود.
برخلاف سایر سرویسهای Google Play ، پیادهسازی استاندارد SDK Ads Google Mobile در APK خدمات Google Play نیز در کتابخانه سرویس گیرنده Google Play گنجانده شده است. این امکان پشتیبانی در دستگاههای بدون APK خدمات Google Play را فراهم میکند. در زمان اجرا، SDK نسخههای کتابخانه سرویس گیرنده و APK خدمات Google Play را مقایسه کرده و از نسخه جدیدتر استفاده میکند.
Lite SDK پیاده سازی Google Mobile Ads SDK را از کتابخانه سرویس گیرنده حذف می کند و تنها یک رابط برای APK خدمات Google Play باقی می گذارد. Lite SDK بر اجرای APK متکی است. اگر برنامه خود را خارج از فروشگاه Google Play نصب کنید، تضمین نمیشود که دستگاههای کاربر شما APK خدمات Google Play را نصب کنند.
در دستگاههای دارای نسخه بهروز سرویسهای Google Play، رفتار Lite SDK مشابه رفتار SDK استاندارد است. با این حال، در دستگاههایی که سرویسهای Google Play قدیمی هستند یا وجود ندارند، Lite SDK ممکن است به APIهایی اشاره کند که در دسترس نیستند یا با APK خدمات Google Play تغییر کردهاند. این منجر به عدم کارکرد و یک خطا در ثبت می شود که ممکن است باعث شود تبلیغات در آن دستگاه ها نمایش داده نشود.
آهنگ انتشار SDK ساده
با شروع نسخه 24.1.0، آرتیفکت play-services-ads-lite با همان آهنگ play-services-ads منتشر نمی شود. این تغییر به اجرای تدریجی و پایدارتر اجرای SDK اجازه می دهد. Lite SDK تقریباً هر سوم نسخه SDK را منتشر می کند.
پروژههایی که هم به play-services-ads-lite نسخه 24.0.0 یا پایینتر و هم به play-services-ads نسخه 24.1.0 یا بالاتر وابسته هستند، در طول کامپایل برنامه با خطای Duplicate class مواجه میشوند. این خطا را فقط با استفاده از یکی از آرتیفکتهای play-services-ads یا play-services-ads-lite برطرف کنید.
تاریخ آخرین بهروزرسانی 2025-09-03 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-09-03 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eThe Google Mobile Ads Lite SDK is a smaller version of the Google Mobile Ads SDK, designed to reduce app size and method references.\u003c/p\u003e\n"],["\u003cp\u003eUsing the Lite SDK helps avoid the 64K reference limit, especially beneficial when targeting older Android versions.\u003c/p\u003e\n"],["\u003cp\u003eThe Lite SDK is exclusively for apps distributed via the Google Play Store and relies on the Google Play services APK for its implementation.\u003c/p\u003e\n"],["\u003cp\u003eOn devices lacking or with outdated Google Play services, the Lite SDK may encounter API discrepancies, leading to ad serving issues.\u003c/p\u003e\n"],["\u003cp\u003eWhile functionally similar to the standard SDK on updated devices, the Lite SDK depends on the Google Play services APK, making it unsuitable for deployments outside the Play Store.\u003c/p\u003e\n"]]],[],null,["Like any Android library, the Google Play services SDK increases the size of\napps that include it. The Google Mobile Ads Lite SDK is a lightweight version\nof Google Mobile Ads SDK built to reduce that impact. It is a fraction of\nthe size of the regular SDK.\n\nAlongside reduced size, using the Lite SDK decreases the total number of\nmethods referenced in an app. This is especially useful when deploying to older\nversions of Android, where developers can run into the [64K reference\nlimit](//developer.android.com/studio/build/multidex).\n\nHere's how to configure gradle to incorporate the Lite SDK into your app: \n\n dependencies {\n implementation 'com.google.android.gms:play-services-ads-lite:24.3.0'\n }\n\nLimitations of the Lite SDK\n\nThe Lite SDK should only be used in apps distributed through the\nGoogle Play store.\n\nUnlike other [Google Play services](/android/guides/overview), the standard\nGoogle Mobile Ads SDK implementation in the Google Play services APK is also\nincluded in the Google Play services client library. This allows for support on\ndevices without the Google Play services APK. At runtime, the SDK will compare\nthe versions of the client library and the Google Play services APK and use the\nnewer version.\n\nThe Lite SDK strips Google Mobile Ads SDK implementation from the client\nlibrary, leaving only an interface to the Google Play services APK. The Lite\nSDK relies on the implementation of the APK. If you deploy your app outside of\nthe Google Play store, it is not guaranteed that your user's devices will have\nthe Google Play services APK installed.\n\nOn devices with an up-to-date version of Google Play services, the Lite SDK's\nbehavior is identical to that of the standard SDK. However, on devices where\nGoogle Play services is outdated or not present, the Lite SDK may reference\nAPIs that are unavailable or have been changed from those in the Google Play\nservices APK. This will result in a no-op and an error being logged, which may\ncause ads not to serve to those devices.\n\nLite SDK release cadence\n\nStarting with version 24.1.0, the `play-services-ads-lite`\nartifact stops releasing at the same cadence as `play-services-ads`. This\nchange allows for a more gradual and stable rollout of the SDK implementation.\nThe Lite SDK releases approximately every third SDK release.\n\nProjects that depend on both `play-services-ads-lite` version 24.0.0 or lower\nand `play-services-ads` version 24.1.0 or higher encounter a `Duplicate class`\nerror during app compilation. Resolve this error by using only one of the\n`play-services-ads` or `play-services-ads-lite` artifacts."]]