ไลบรารี Play Core พร้อมให้บริการใน
Javaเนทีฟ และ Unity ดูข้อมูลเพิ่มเติมเกี่ยวกับการเปิดตัวล่าสุดได้ที่บันทึกประจำรุ่น
การย้ายข้อมูลจากไลบรารี Java และ Kotlin ของ Play Core
เราได้แบ่งไลบรารี Java และ Kotlin ของ Play Core ออกเป็นไลบรารี Android หลายรายการ
ต่อฟีเจอร์ ซึ่งจะช่วยลดขนาดที่ไลบรารี Play Core เพิ่มลงในแอปของคุณ และช่วยให้รอบการเผยแพร่ฟีเจอร์แต่ละรายการเร็วขึ้น
ลักษณะการทำงานของแต่ละฟีเจอร์ยังคงสอดคล้องกันในการย้ายข้อมูลครั้งนี้ การเปลี่ยนแปลงที่เห็นได้ชัดเพียงอย่างเดียวคือเวอร์ชันใหม่ได้นำ Task API ของบริการ Google Play มาใช้
ใช้รายการด้านล่างเพื่อย้ายข้อมูลไปยังไลบรารีใหม่และรับประโยชน์จากฟีเจอร์ใหม่ๆ
และการแก้ไขข้อบกพร่อง หากใช้ฟีเจอร์หลายอย่างของ Play คุณสามารถนำเข้าไลบรารีหลายรายการในไฟล์ build.gradle พร้อมกันได้
นำการนำเข้าไลบรารี Play Core เวอร์ชันเก่าในไฟล์ build.gradle ออก
ผสานรวมไลบรารี Play Asset Delivery
Groovy
// 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'...}
Kotlin
// 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
Groovy
// 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'...}
Kotlin
// 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
Groovy
// 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'...}
Kotlin
// 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
Groovy
// 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'...}
Kotlin
// 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
แก้ไขล่าสุด: 24 กันยายน 2020
การใช้ชุดพัฒนาซอฟต์แวร์ Play Core แสดงว่าคุณยอมรับข้อกำหนดเหล่านี้ นอกเหนือจากข้อกำหนดในการให้บริการของ Google APIs ("ข้อกำหนดในการให้บริการของ API") หากข้อกำหนดเหล่านี้ขัดแย้งกัน ข้อกำหนดเหล่านี้จะมีผลเหนือกว่าข้อกำหนดในการให้บริการของ API โปรดอ่านข้อกำหนดเหล่านี้และข้อกำหนดในการให้บริการของ API อย่างละเอียด
เพื่อวัตถุประสงค์ของข้อกำหนดเหล่านี้ "API" หมายถึง API ของ Google, บริการอื่นๆ สำหรับนักพัฒนาซอฟต์แวร์ และซอฟต์แวร์ที่เกี่ยวข้อง รวมถึงโค้ดที่แจกจ่ายต่อได้
"โค้ดที่แจกจ่ายต่อได้" หมายถึงโค้ดออบเจ็กต์หรือไฟล์ส่วนหัวที่ Google จัดหาให้ซึ่งเรียกใช้ API
ภายใต้ข้อกำหนดเหล่านี้และข้อกำหนดของข้อกำหนดในการให้บริการของ API คุณสามารถคัดลอกและเผยแพร่โค้ดที่แจกจ่ายต่อได้เพื่อรวมไว้เป็นส่วนหนึ่งของไคลเอ็นต์ API เท่านั้น Google และผู้อนุญาตของ Google เป็นเจ้าของสิทธิ กรรมสิทธิ์ และผลประโยชน์ทั้งหมด รวมถึงทรัพย์สินทางปัญญาทั้งหมดและสิทธิ์อื่นๆ ที่เป็นกรรมสิทธิ์ในและต่อโค้ดที่แจกจ่ายต่อได้ คุณจะไม่ดัดแปลง แปล หรือสร้างผลงานดัดแปลงจากโค้ดที่แจกจ่ายได้
Google อาจทำการเปลี่ยนแปลงข้อกำหนดเหล่านี้ได้ทุกเมื่อโดยมีการแจ้งให้ทราบและสามารถห้ามการใช้งานชุดพัฒนาซอฟต์แวร์ Play Core ต่อไปได้ Google จะโพสต์ประกาศแจ้งการเปลี่ยนแปลงข้อกำหนดที่ https://developer.android.com/guide/playcore/license การเปลี่ยนแปลงจะไม่มีผลย้อนหลัง
[[["เข้าใจง่าย","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-27 UTC"],[],[],null,["# Overview of the Google Play Core libraries\n\nThis page describes the Google Play Core libraries and how to add them to your\nproject.\n| **Important:** The Google Play Core Java and Kotlin library have been split into multiple separate libraries, one for each feature. Update to the new libraries to benefit from new product additions. For more information, see the [migration guide](#playcore-migration).\n\nThe Google Play Core libraries are your app's runtime interface with the Google Play\nStore. Some of the things you can do include the following:\n\n- [Download additional language resources](/guide/playcore/feature-delivery/on-demand#lang_resources)\n- [Manage delivery of feature modules](/guide/playcore/feature-delivery)\n- [Manage delivery of asset packs](/guide/playcore/asset-delivery)\n- [Trigger in-app updates](/guide/playcore/in-app-updates)\n- [Request in-app reviews](/guide/playcore/in-app-review)\n\nThe Play Core libraries are available in\n[Java](/reference/com/google/android/play/core/packages),\n[native](/reference/native/play/core), and [Unity](/reference/unity). For more\ninformation about the latest releases, see the\n[Release notes](/reference/com/google/android/play/core/release-notes).\n\nMigration from the Play Core Java and Kotlin Library\n----------------------------------------------------\n\nThe Play Core Java and Kotlin Library has been partitioned into multiple\nper-feature Android libraries. This reduces the size Play Core libraries add to\nyour app and allows for faster release cycles of the individual features.\n\nThe behavior of each feature has stayed consistent in this migration, the only\nnotable change is that the new versions have adopted [Google Play Services' Task API](https://developers.google.com/android/reference/com/google/android/gms/tasks/Task).\n\nUse the list below to migrate to the new libraries and benefit from new features\nand bug fixes. If you use multiple Play features, you can simply import multiple\nlibraries in your `build.gradle` file at once.\n\n### Common migration steps\n\n1. Update any existing import statements of Task objects from `import com.google.android.play.core.tasks.*;` to `import com.google.android.gms.tasks.*;`. All class names are unchanged.\n2. Remove any imports of the old Play Core libraries in your `build.gradle` file.\n\n### Integrate the Play Asset Delivery Library\n\n### Groovy\n\n```groovy\n// In your app's build.gradle file:\n...\ndependencies {\n // This dependency is downloaded from the /studio/build/dependencies#google-maven.\n // So, make sure you also include that repository in your project's build.gradle file.\n implementation 'com.google.android.play:asset-delivery:2.3.0'\n\n // For Kotlin users also add the Kotlin extensions library for Play Asset Delivery:\n implementation 'com.google.android.play:asset-delivery-ktx:2.3.0'\n ...\n}\n```\n\n### Kotlin\n\n```kotlin\n// In your app's build.gradle.kts file:\n...\ndependencies {\n // This dependency is downloaded from the /studio/build/dependencies#google-maven.\n // So, make sure you also include that repository in your project's build.gradle file.\n implementation(\"com.google.android.play:asset-delivery:2.3.0\")\n\n // For Kotlin users also import the Kotlin extensions library for Play Asset Delivery:\n implementation(\"com.google.android.play:asset-delivery-ktx:2.3.0\")\n ...\n}\n```\n\n### Integrate the Play Feature Delivery Library\n\n### Groovy\n\n```groovy\n// In your app's build.gradle file:\n...\ndependencies {\n // This dependency is downloaded from the /studio/build/dependencies#google-maven.\n // So, make sure you also include that repository in your project's build.gradle file.\n implementation 'com.google.android.play:feature-delivery:2.1.0'\n\n // For Kotlin users, also add the Kotlin extensions library for Play Feature Delivery:\n implementation 'com.google.android.play:feature-delivery-ktx:2.1.0'\n ...\n}\n```\n\n### Kotlin\n\n```kotlin\n// In your app's build.gradle.kts file:\n...\ndependencies {\n // This dependency is downloaded from the /studio/build/dependencies#google-maven.\n // Make sure you also include that repository in your project's build.gradle file.\n implementation(\"com.google.android.play:feature-delivery:2.1.0\")\n\n // For Kotlin users, also import the Kotlin extensions library for Play Feature Delivery:\n implementation(\"com.google.android.play:feature-delivery-ktx:2.1.0\")\n ...\n}\n```\n\n### Integrate the Play In-App Review Library\n\n### Groovy\n\n```groovy\n// In your app's build.gradle file:\n...\ndependencies {\n // This dependency is downloaded from the /studio/build/dependencies#google-maven.\n // Make sure you also include that repository in your project's build.gradle file.\n implementation 'com.google.android.play:review:2.0.2'\n\n // For Kotlin users, also add the Kotlin extensions library for Play In-App Review:\n implementation 'com.google.android.play:review-ktx:2.0.2'\n ...\n}\n```\n\n### Kotlin\n\n```kotlin\n// In your app's build.gradle.kts file:\n...\ndependencies {\n // This dependency is downloaded from the /studio/build/dependencies#google-maven.\n // Make sure you also include that repository in your project's build.gradle file.\n implementation(\"com.google.android.play:review:2.0.2\")\n\n // For Kotlin users, also import the Kotlin extensions library for Play In-App Review:\n implementation(\"com.google.android.play:review-ktx:2.0.2\")\n ...\n}\n```\n\n### Integrate the Play In-App Update Library\n\n### Groovy\n\n```groovy\n// In your app's build.gradle file:\n...\ndependencies {\n // This dependency is downloaded from the /studio/build/dependencies#google-maven.\n // Make sure you also include that repository in your project's build.gradle file.\n implementation 'com.google.android.play:app-update:2.1.0'\n\n // For Kotlin users, also add the Kotlin extensions library for Play In-App Update:\n implementation 'com.google.android.play:app-update-ktx:2.1.0'\n ...\n}\n```\n\n### Kotlin\n\n```kotlin\n// In your app's build.gradle.kts file:\n...\ndependencies {\n // This dependency is downloaded from the /studio/build/dependencies#google-maven.\n // Make sure you also include that repository in your project's build.gradle file.\n implementation(\"com.google.android.play:app-update:2.1.0\")\n\n // For Kotlin users, also import the Kotlin extensions library for Play In-App Update:\n implementation(\"com.google.android.play:app-update-ktx:2.1.0\")\n ...\n}\n```\n\nPlay Core Software Development Kit Terms of Service\n---------------------------------------------------\n\nLast modified: September 24, 2020\n\n1. By using the Play Core Software Development Kit, you agree to these terms in addition to the [Google APIs Terms of Service](https://developers.google.com/terms) (\"API ToS\"). If these terms are ever in conflict, these terms will take precedence over the API ToS. Please read these terms and the API ToS carefully.\n2. For purposes of these terms, \"APIs\" means Google's APIs, other developer services, and associated software, including any Redistributable Code.\n3. \"Redistributable Code\" means Google-provided object code or header files that call the APIs.\n4. Subject to these terms and the terms of the API ToS, you may copy and distribute Redistributable Code solely for inclusion as part of your API Client. Google and its licensors own all right, title and interest, including any and all intellectual property and other proprietary rights, in and to Redistributable Code. You will not modify, translate, or create derivative works of Redistributable Code.\n5. Google may make changes to these terms at any time with notice and the opportunity to decline further use of the Play Core Software Development Kit. Google will post notice of modifications to the terms at \u003chttps://developer.android.com/guide/playcore/license\u003e. Changes will not be retroactive."]]