1

I am looking for a best practice for considering internal vs. external storage depending on file size.

The docs give no size reference for internal storage getFilesDir(), but 1MB for getCacheDir():

You should always maintain the cache files yourself and stay within a reasonable limit of space consumed, such as 1MB.

Let's say an app needs to temporarily store video files, that are internal to the application. Assume 20 video files with 5MB each means 100MB total.

Is it reliable that the app can store 100MB in internal storage with getFilesDir()?

Manuel
  • 14,274
  • 6
  • 57
  • 130
  • Possible duplicate of [is there a maximum size to android internal storage allocated for an app?](https://stackoverflow.com/questions/9198440/is-there-a-maximum-size-to-android-internal-storage-allocated-for-an-app) – Manuel Oct 17 '18 at 17:41

1 Answers1

1

The Android 9 Compatibility Definition says:

Handheld device implementations:

[7.6.1/H-0-1] MUST have at least 4 GB of non-volatile storage available for application private data (a.k.a. "/data" partition).

I believe this means that getFilesDir() is required to be at least 4 GB.

For Android 4.3:

Device implementations MUST have at least 512MB of non-volatile storage available for user data. That is, the /data partition MUST be at least 512MB.

Each Android version has a different amount of required storage space per app. If you are interested in the details, check out the other ACDs.

Manuel
  • 14,274
  • 6
  • 57
  • 130