I want to store some video/audio files in raw folder of my application.
I don\'t know the storage limit of raw and asset folder.
Can anybody tell me how much dat
According to The reason for Assets and Raw Resources in Android:
The main differences between the
raw
folder and theAssets
folder.
Since raw is a subfolder of Resources (res), Android will automatically generate an
ID
for any file located inside it. This
ID
is then stored an theR class
that will act as a reference to
a file, meaning it can be easily accessed from other Android classes
and methods and even in Android XML files. Using the automatically
generated ID is the fastest way to have access to a file in Android.The Assets folder is an “appendix” directory. The R class does not generate IDs for the files placed there, so its less compatible with some Android classes and methods. Also, it’s much slower to access a file inside it, since you will need to get a handle to it based on a String. There is also a 1MB size limit for files placed there, however some operations are more easily done by placing files in this folder, like copying a database file to the system’s memory. There’s no (easy) way to create an Android XML reference to files inside the Assets folder.
The limit on any resource that will be compressed by apk is 1MB, either in the raw directory or under assets. This is because it is compressed by apk at build time, and relies on phone hardware resources on the handset to uncompress it. A limit of 1MB is imposed so that a handset can uncompress it, even with limited resource.
Check out more in the HERE the use of the raw folder about its size and many more. Also check the Android apps file size limit blog HERE