
Caution: The exact location of where your files can be saved might vary acrossĭevices.
Preference manager java storeage location on mac android#
Android represents these devices using a path, such as

Removable volumes, such as an SD card, appear in the file system as part ofĮxternal storage. However, internal storage is always available on all devices, making itĪ more reliable place to put data on which your app depends. On most devices, internal storage is smaller than external Categories of storage locationsĪndroid provides two types of physical storage locations: internal storage andĮxternal storage. Internal storage has theĪdded benefit of the data being hidden from users. Should the data be private to your app? When storing sensitive data-data that shouldn't be accessible from any otherĪpp-use internal storage, preferences, or a database. For structured data, use either preferences (for key-valueĭata) or a database (for data that contains more than 2 columns). For shareable media content, use shared storage so that other apps canĪccess the content. What kind of data do you need to store? If you have data that's only meaningful for your app, use app-specific Is starting up, place the data within internal storage directory or a database.Īpp-specific files that are stored in external storage aren't always accessibleīecause some devices allow users to remove a physical device that corresponds toĮxternal storage. How reliable does data access need to be? If your app's basic functionality requires certain data, such as when your app Storage if you need to save a substantial amount of data. The solution you choose depends on your specific needs: How much space does your data require? Internal storage has limited space for app-specific data. Other types of shareable content, including downloaded files Yes, though the other app needs the READ_EXTERNAL_STORAGE Permissions are required for all files on Android 9 (API level 28) or When accessing other apps' files on Android 10 (API level 29) READ_EXTERNAL_STORAGE or WRITE_EXTERNAL_STORAGE READ_EXTERNAL_STORAGE when accessing other apps' files on Shareable media files (images, audio files, videos) Storage when your app is used on devices that run Android 4.4 (API level 19) The characteristics of these options are summarized in the following table: Databases: Store structured data in a private database using the Room.Preferences: Store private, primitive data in key-value pairs.Shared storage: Store files that your app intends to share with otherĪpps, including media, documents, and other files.Internal storage to save sensitive information that other apps shouldn't access.


Android uses a file system that's similar to disk-based file systems on other
