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

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

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

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

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

ספריית Play Core Java וספריית 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 בקובץ 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.2.2'

    // For Kotlin users also add the Kotlin extensions library for Play Asset Delivery:
    implementation 'com.google.android.play:asset-delivery-ktx:2.2.2'
    ...
}

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

    // For Kotlin users also import the Kotlin extensions library for Play Asset Delivery:
    implementation("com.google.android.play:asset-delivery-ktx:2.2.2")
    ...
}

שילוב של ספריית הפצת הפיצ'רים ב-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 In-App Review

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.1'

    // For Kotlin users, also add the Kotlin extensions library for Play In-App Review:
    implementation 'com.google.android.play:review-ktx:2.0.1'
    ...
}

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

    // For Kotlin users, also import the Kotlin extensions library for Play In-App Review:
    implementation("com.google.android.play:review-ktx:2.0.1")
    ...
}

שילוב של ספריית העדכונים מתוך האפליקציה של 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

תאריך השינוי האחרון: 24 בספטמבר 2020
  1. השימוש בערכת פיתוח התוכנה המרכזית של Play מבטא את הסכמתך לתנאים האלה בנוסף לתנאים ולהגבלות של 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/שונות. השינויים לא יחולו באופן רטרואקטיבי.