I am developing an application where I have to use three different size's file (1mb, 5mb, 15mb). I searched, then came to know that we can keep these video in assets folder and can use those video.
Secondly, I came to know that we can keep these videos in assets folder and installation time we can move all videos to SD card. when tried second approach faced problem due to bigger file size.
So, can anyone please tell me what is difference between both approaches and which one I should use. Any pointer will be appreciated.
The Assets folder is where you should save or copy files that you want to use in your project. The contents of the Project Window in Unity shows the items in your Assets folder.
Assets provide a way to add arbitrary files like text, XML, HTML, fonts, music, and video in the application. If one tries to add these files as “resources“, Android will treat them into its resource system and you will be unable to get the raw data.
Now, Right-click on the Assets folder and click on the File option by hovering over the New option. Enter the name of the file name and click Enter to create the file.
Files over 1mb placed in the assets folder
won't be readable from your app (It'll throw an exception).
This is because they get compressed
during the build process, and thus the phone requires substantial resources
to uncompress them when on the handset.
If the asset
is compressed
, the system has to uncompress
the entire thing to memory
. If you have a 20MB asset, that means 20MB of physical memory
is tied up by your application.
I believe you can place them in the raw folder
, where they won't get compressed.
EDIT :
You can upload upto 50MB file sized APK to android market, that is standard and it is now giving support to bigger sized APK's too. See below reference link for this:
Android Apps Break the 50MB Barrier
Thanks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With