סקירה כללית על אחסון משותף
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
כדאי להשתמש באחסון משותף לנתוני משתמשים שיכולים להיות נגישים לאפליקציות אחרות או שצריכים להיות נגישים להן, ושיש לשמור אותם גם אם המשתמש מסיר את האפליקציה.
ב-Android יש ממשקי API לאחסון ולגישה לסוגים הבאים של נתונים שאפשר לשתף:
- תוכן מדיה: המערכת מספקת ספריות ציבוריות רגילות לסוגי הקבצים האלה, כך שלמשתמש יש מיקום משותף לכל התמונות שלו, מיקום משותף אחר לכל קובצי המוזיקה והאודיו שלו וכן הלאה. האפליקציה יכולה לגשת לתוכן הזה באמצעות ה-API של הפלטפורמה,
MediaStore
.
- מסמכים וקבצים אחרים: במערכת יש ספרייה מיוחדת שמכילה סוגי קבצים אחרים, כמו מסמכי PDF וספרים בפורמט EPUB. האפליקציה יכולה לגשת לקבצים האלה באמצעות Storage Access Framework של הפלטפורמה.
- מערכי נתונים: ב-Android 11 (רמת API 30) ואילך, המערכת שומרת במטמון מערכי נתונים גדולים שיכולות להשתמש בהם כמה אפליקציות. מערכי הנתונים האלה יכולים לתמוך בתרחישי שימוש כמו למידת מכונה והפעלת מדיה. אפליקציות יכולות לגשת למערכי הנתונים המשותפים האלה באמצעות ה-API של
BlobStoreManager
.
מידע נוסף על ממשקי ה-API האלה זמין במדריכים הבאים:
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-02-10 (שעון UTC).
[[["התוכן קל להבנה","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-02-10 (שעון UTC)."],[],[],null,["# Overview of shared storage\n\nUse shared storage for user data that can or should be accessible to other apps\nand saved even if the user uninstalls your app.\n\nAndroid provides APIs for storing and accessing the following types of shareable\ndata:\n\n- **Media content:** The system provides standard public directories for these kinds of files, so the user has a common location for all their photos, another common location for all their music and audio files, and so on. Your app can access this content using the platform's [`MediaStore`](/reference/android/provider/MediaStore) API.\n- **Documents and other files:** The system has a special directory for containing other file types, such as PDF documents and books that use the EPUB format. Your app can access these files using the platform's Storage Access Framework.\n- **Datasets:** On Android 11 (API level 30) and higher, the system caches large datasets that multiple apps might use. These datasets can support use cases like machine learning and media playback. Apps can access these shared datasets using the [`BlobStoreManager`](/reference/android/app/blob/BlobStoreManager) API.\n\nFor more information about these APIs, see the following guides:\n\n- [Media content](/training/data-storage/shared/media)\n- [Documents and other files](/training/data-storage/shared/documents-files)\n- [Datasets](/training/data-storage/shared/datasets)"]]