androidkotlinmemory-managementlocal-storageandroid-storage

Is there any limit to store the files inside the app-specific storage[data/data/{packagename}] in Android?


Usecase: I would like to store the files into the app-specific storage completely so that no one can access the files directly.

I have stored files into the internal storage[storage/emulated/xxx/xxx] and app-specific storage[data/data/com.x.x]but I didn't get any exceptions from the device until storage is full. I couldn't find anything about the restriction of app-specific storage in Android Docs, is there any limit really? Please find the devices which I have tested below.

  1. Samsung Tab 32GB [Stored up to 20GB in app-specific storage]
  2. Samsung S10 128GB [Stored up to 100GB in app-specific storage]
  3. OnePlus7 128GB [Stored up to 100GB in app-specific storage]

As per my R&D on app-specific storage, there are no limitations. But I can't find this in the Android documentation. Can someone help me with this?


Solution

  • Yes, there is no storage limit specified in the android document. But it mentioned that "Internal storage has limited space for app-specific data. Use other types of storage if you need to save a substantial amount of data."

    You can write the multiple files unless storage is available otherwise it will throw the IOException.

    It is also mentioned that "if you read or write the same files for multiple times then it can impact the application performance" if you are using app-specific storage.

    It basically stores the files that are meant for your app's use only.

    So choose storage wisely.

    You can read more information here or Android Dev Summit '19.

    I hope it helps you!