5

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.

Roman C
  • 49,761
  • 33
  • 66
  • 176
CodingRat
  • 1,934
  • 3
  • 23
  • 43

1 Answers1

5

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.

Pratik Sharma
  • 13,307
  • 5
  • 27
  • 37
  • Thanks for help pratik so is it possible one can delete file from raw folder ? If i keep three video sized as mentioned then my apk will be size of around 30 MB so i don't think that there will be a problem in uploading app but still i want to confirm ? – CodingRat Jan 10 '13 at 13:10
  • 1
    @GauravSharma yes you can upload that to google market with 30MB size. There will be no problem. And there will not be possibility to delete files from the raw folder. – Pratik Sharma Jan 10 '13 at 13:13
  • 1
    @GauravSharma see my edit I have posted that will be helpful to you. – Pratik Sharma Jan 10 '13 at 13:19