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

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

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

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

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

ספריית Play Core Java and Kotlin חולקה לכמה ספריות Android לכל תכונה. כך אפשר להקטין את הנפח שספריות Play Core מוסיפות לאפליקציה, ולקצר את מחזורי ההשקה של התכונות השונות.

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

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

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

  1. מעדכנים את כל הצהרות הייבוא הקיימות של אובייקטים מסוג Task מ-import com.google.android.play.core.tasks.*; ל-import com.google.android.gms.tasks.*;. כל שמות הכיתות לא השתנו.
  2. מסירים את כל הייבואים של ספריות Play Core הישנות בקובץ build.gradle.

שילוב של ספריית Play Asset 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: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"

מגניב

// 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 In-App Review Library

מגניב

// 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 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 מבטא את הסכמתך לתנאים האלה בנוסף לתנאים ולהגבלות של Google APIs ("התנאים וההגבלות של ה-API"). במקרה של סתירה בין התנאים האלה לבין התנאים וההגבלות של ה-API, התנאים האלה יקבלו עדיפות. חשוב לקרוא בעיון את התנאים האלה ואת התנאים וההגבלות של ה-API.
  2. למטרות התנאים האלה, "ממשקי API" הם ממשקי ה-API של Google, שירותים אחרים למפתחים ותוכנות משויכות, כולל כל קוד שניתן להפצה מחדש.
  3. "קוד שניתן להפצה חוזרת" פירושו קוד אובייקט או קובצי כותרת ש-Google מספקת, שקוראים לממשקי ה-API.
  4. בכפוף לתנאים האלה ולתנאים של התנאים וההגבלות של ה-API, מותר לך להעתיק ולהפיץ קוד שניתן להפצה חוזרת רק כדי לכלול אותו כחלק מלקוח ה-API שלך. ‫Google ובעלי הרישיון שלה הם הבעלים של כל הזכויות, הבעלות והזיקה, כולל כל זכויות הקניין הרוחני וזכויות קנייניות אחרות, בקוד שניתן להפצה חוזרת. אין לשנות, לתרגם או ליצור יצירות נגזרות של קוד שניתן להפצה חוזרת.
  5. ‫Google רשאית לשנות את התנאים האלה בכל שלב, אבל היא חייבת להודיע על כך ולתת הזדמנות לסרב להמשיך להשתמש בערכת כלים לפיתוח תוכנה (SDK) של Play Core. ‫Google תפרסם הודעה לגבי שינויים בתנאים בכתובת https://developer.android.com/guide/playcore/license. השינויים לא יחולו באופן רטרואקטיבי.