סקירה כללית של ספריות הליבה של Google Play

בדף הזה מוסבר על ספריות הליבה של Google Play ואיך מוסיפים אותן לפרויקט.

ספריות הליבה של Google Play הן ממשק זמן הריצה של האפליקציה עם חנות Google Play. אלה כמה מהפעולות שאפשר לבצע:

ספריות Play Core זמינות ב-Java, ב-native וב-Unity. מידע נוסף על הגרסאות האחרונות זמין בהערות המוצר.

מעבר מספריית Java ו-Kotlin של Play Core

ספריית Java ו-Kotlin של Play Core חולקה לספריות Android רבות, כל אחת עם תכונה משלה. כך מצמצמים את הגודל של ספריות Play Core שנוספות לאפליקציה, ומאפשרים מחזורי פרסום מהירים יותר של התכונות השונות.

ההתנהגות של כל תכונה נשארה עקבית בהעברה הזו. השינוי הבולט היחיד הוא שבגרסאות החדשות נעשה שימוש ב-Task API של Google Play Services.

כדי לעבור לספריות החדשות וליהנות מתכונות חדשות ומתיקוני באגים, אפשר להיעזר ברשימה שלמטה. אם אתם משתמשים בכמה תכונות של Play, אתם יכולים לייבא כמה ספריות בבת אחת בקובץ build.gradle.

שלבים נפוצים בהעברה

  1. מעדכנים את כל הצהרות הייבוא הקיימות של אובייקטים של משימות מ-import com.google.android.play.core.tasks.*; ל-import com.google.android.gms.tasks.*;. כל שמות הכיתות לא משתנים.
  2. מסירים את כל הייבוא של ספריות 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 Feature Delivery Library

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 In-App Update Library

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")
    ...
}

התנאים וההגבלות של ערכת הכלים לפיתוח תוכנה (SDK) של Play Core

תאריך שינוי אחרון: 24 בספטמבר 2020
  1. השימוש שלך ב-Play Core Software Development Kit מהווה את הסכמתך לתנאים האלה, בנוסף לתנאים ולהגבלות של Google APIs ("התנאים וההגבלות של ה-API"). במקרה של סתירה בין התנאים האלה לבין התנאים וההגבלות של ה-API, התנאים האלה יקבלו עדיפות. חשוב לקרוא בעיון את התנאים האלה ואת התנאים וההגבלות של ה-API.
  2. לצורך התנאים האלה, 'ממשקי API' הם ממשקי ה-API של Google, שירותים אחרים למפתחים ותוכנות משויכות, כולל קוד שניתן להפצה מחדש.
  3. 'קוד ניתן להפצה מחדש' פירושו קוד אובייקט או קובצי כותרת ש-Google מספקת ומפעילים את ממשקי ה-API.
  4. בכפוף לתנאים האלה ולתנאים של התנאים וההגבלות של ה-API, מותר לכם להעתיק ולהפיץ קוד שניתן להפצה מחדש רק לצורך הכללה כחלק מלקוח ה-API שלכם. ‫Google והמעניקים שלה מחזיקים בכל הזכויות, הבעלות והזיקה, כולל כל זכויות הקניין הרוחני וזכויות קנייניות אחרות, בקוד שניתן להפצה מחדש. אסור לשנות, לתרגם או ליצור עבודות נגזרות של קוד שניתן להפצה מחדש.
  5. ‫Google רשאית לבצע שינויים בתנאים האלה בכל זמן, לאחר שליחת הודעות ומתן הזדמנות לסרב לשינויים ולהפסיק את השימוש ב-Play Core Software Development Kit. ‫Google תפרסם הודעה לגבי שינויים בתנאים בכתובת https://developer.android.com/guide/playcore/license. השינויים לא יחולו באופן רטרואקטיבי.