این صفحه کتابخانههای «هسته Google Play» و نحوه افزودن آنها به پروژه را شرح میدهد.
کتابخانههای «هسته Google Play» میانای زمان اجرای برنامه شما با «فروشگاه Google Play» است. برخیاز کارهایی که میتوانید انجام دهید عبارتند از:
- بارگیری منابع زبان اضافی
- مدیریت کردن توزیع واحدهای ویژگی
- مدیریت کردن توزیع بستههای دارایی
- راهاندازی بهروزرسانیهای درونبرنامهای
- درخواست مرورهای درونبرنامه
کتابخانههای Play Core در Java، native، و Unity دردسترس هستند. برای اطلاعات بیشتر درباره جدیدترین نسخههای پخش، به یادداشتهای انتشار مراجعه کنید.
انتقال از کتابخانه Play Core Java و Kotlin
«کتابخانه Play Core Java and Kotlin» به چند کتابخانه Android تقسیم شده است که هرکدام ویژگی خاصی دارند. این کار باعث کاهش اندازهای میشود که کتابخانههای «هسته Play» به برنامهتان اضافه میکنند و چرخههای انتشار سریعتر ویژگیهای مجزا را ممکن میسازد.
رفتار هر ویژگی در این انتقال ثابت مانده است، تنها تغییر قابلتوجه این است که نسخههای جدید Task API «خدمات Google Play» را اتخاذ کردهاند.
از فهرست زیر برای انتقال به کتابخانههای جدید و بهرهمندی از ویژگیهای جدید و رفع اشکالها استفاده کنید. اگر از چندین ویژگی Play استفاده میکنید، میتوانید بهراحتی چندین کتابخانه را بهطور همزمان در فایل build.gradle خود وارد کنید.
مراحل متداول انتقال
- هرگونه عبارت واردات موجود از اشیاء Task را از
import com.google.android.play.core.tasks.*;بهimport com.google.android.gms.tasks.*;بهروز کنید. همه نامهای کلاس بدون تغییر باقی ماند. - هرگونه واردات کتابخانههای قدیمی «هسته Play» را در فایل
build.gradleخود بردارید.
ادغام کردن «کتابخانه ارائه داراییهای Play»
شیک
// In your app's build.gradle file: ... dependencies { // This dependency is downloaded from the Google's Maven repository. // So, make sure you also include that repository in your project's build.gradle file. implementation 'com.google.android.play:asset-delivery:2.3.0' // For Kotlin users also add the Kotlin extensions library for Play Asset Delivery: implementation 'com.google.android.play:asset-delivery-ktx:2.3.0' ... }
کاتلین
// In your app's build.gradle.kts file: ... dependencies { // This dependency is downloaded from the Google's Maven repository. // So, make sure you also include that repository in your project's build.gradle file. implementation("com.google.android.play:asset-delivery:2.3.0") // For Kotlin users also import the Kotlin extensions library for Play Asset Delivery: implementation("com.google.android.play:asset-delivery-ktx:2.3.0") ... }
ادغام کردن «کتابخانه Play Feature Delivery»
شیک
// In your app's build.gradle file: ... dependencies { // This dependency is downloaded from the Google's Maven repository. // So, make sure you also include that repository in your project's build.gradle file. implementation 'com.google.android.play:feature-delivery:2.1.0' // For Kotlin users, also add the Kotlin extensions library for Play Feature Delivery: implementation 'com.google.android.play:feature-delivery-ktx:2.1.0' ... }
کاتلین
// In your app's build.gradle.kts file: ... dependencies { // This dependency is downloaded from the Google's Maven repository. // Make sure you also include that repository in your project's build.gradle file. implementation("com.google.android.play:feature-delivery:2.1.0") // For Kotlin users, also import the Kotlin extensions library for Play Feature Delivery: implementation("com.google.android.play:feature-delivery-ktx:2.1.0") ... }
ادغام کردن «کتابخانه مرور درونبرنامهای Play»
شیک
// In your app's build.gradle file: ... dependencies { // This dependency is downloaded from the Google's Maven repository. // Make sure you also include that repository in your project's build.gradle file. implementation 'com.google.android.play:review:2.0.2' // For Kotlin users, also add the Kotlin extensions library for Play In-App Review: implementation 'com.google.android.play:review-ktx:2.0.2' ... }
کاتلین
// In your app's build.gradle.kts file: ... dependencies { // This dependency is downloaded from the Google's Maven repository. // Make sure you also include that repository in your project's build.gradle file. implementation("com.google.android.play:review:2.0.2") // For Kotlin users, also import the Kotlin extensions library for Play In-App Review: implementation("com.google.android.play:review-ktx:2.0.2") ... }
ادغام کردن «کتابخانه بهروزرسانی درونبرنامهای Play»
شیک
// In your app's build.gradle file: ... dependencies { // This dependency is downloaded from the Google's Maven repository. // Make sure you also include that repository in your project's build.gradle file. implementation 'com.google.android.play:app-update:2.1.0' // For Kotlin users, also add the Kotlin extensions library for Play In-App Update: implementation 'com.google.android.play:app-update-ktx:2.1.0' ... }
کاتلین
// In your app's build.gradle.kts file: ... dependencies { // This dependency is downloaded from the Google's Maven repository. // Make sure you also include that repository in your project's build.gradle file. implementation("com.google.android.play:app-update:2.1.0") // For Kotlin users, also import the Kotlin extensions library for Play In-App Update: implementation("com.google.android.play:app-update-ktx:2.1.0") ... }
شرایط خدمات کیت توسعه نرمافزار Play Core
تاریخ آخرین اصلاح: ۲۴ سپتامبر ۲۰۲۰- درصورت استفاده از «کیت توسعه نرمافزار Play Core»، علاوهبر شرایط خدمات Google APIs («شرایط خدمات API»)، با این شرایط نیز موافقت میکنید. اگر این شرایط در تضاد با یکدیگر قرار گرفتند، این شرایط بر «شرایط خدمات API» اولویت دارد. لطفاً این شرایط و «شرایط خدمات API» را بهدقت بخوانید.
- برای اهداف این شرایط، «APIs» به «Google APIs»، دیگر سرویسهای توسعهدهنده، و نرمافزارهای مرتبط، ازجمله هرگونه «کد با قابلیت بازتوزیع» اشاره میکند.
- «کد با قابلیت بازتوزیع» به کد هدف یا سرفایلهایی اشاره دارد که APIs را فراخوانی میکند و ازسوی Google ارائه شده است.
- طبق این شرایط و «شرایط خدمات API»، شما اجازه دارید «کد با قابلیت بازتوزیع» را صرفاً برای افزودن بهعنوان بخشی از «کارخواه API» خود کپی و توزیع کنید. Google و صادرکنندگان پروانه آن صاحب کلیه حقوق، مالکیت، و بهره، ازجمله کلیه حقوق مالکیت فکری و حقوق اختصاصی دیگر، در «کد با قابلیت بازتوزیع» هستند. اجازه ندارید «کد با قابلیت بازتوزیع» را دستکاری کنید، آن را ترجمه کنید، یا آثار اقتباسی از آن بسازید.
- ممکن است Google درهرزمانی تغییراتی در این شرایط ایجاد کند. این کار با ارائه اعلان و فرصتی برای نپذیرفتن ادامه استفاده از «کیت توسعه نرمافزار هسته Play» انجام خواهد شد. Google اعلان تغییرات در شرایط را در https://developer.android.com/guide/playcore/license پست خواهد کرد. تغییرات عطف به ماسبق نخواهد بود.