0

I've been developing this content-based app for Android which includes over 120 MB of video .mp4-files saved on the raw folder and in addition it includes over 20 MB of sound files also saved in the raw folder.

The problem is I cannot install the app on my Android phone due to limited internal memory to handle all those files. Also, I read somewhere that the app size limit on the Android market is 50MB so I won't be able to even upload the damn thing.

I've saved the videos on the raw folder as I was able to play them fine (using VideoView).

My question is how do i cope with such size, do I have to go through making the user download the content after installing the app or is there any other way of dealing with such sizes (~140 MB).

Lukas Knuth
  • 25,449
  • 15
  • 83
  • 111
bytebiscuit
  • 3,446
  • 10
  • 33
  • 53

2 Answers2

3

You cannot distribute an APK through the market that is more than 50MB. Its not a good idea to take up 120MB of the internal storage for a single app as many phones don't have a lot of internal storage space.

You should consider stripping out all of the large files, hosting them on a server and then having the application download the files on the first launch. I would also recommend you save the files to the SD card so you don't use up too much of the precious internal storage.

Edit: I will admit that any time an app tries to download a lot of data on the initial launch I get really frustrated. Make sure you do it in a way that doesn't require the activity to be open the entire time the file is downloading. Do the downloading through a service so the user can at least use their phone while your app is downloading the media files.

slayton
  • 20,123
  • 10
  • 60
  • 89
  • Is there any reference you can possibly give me of an example implementing this. I haven't had much experience with using services or downloading content after app is installed. Would really appreciate it!! I'm thinking, when the user downloads the videos, the videos are stored on the SD card, so then I have to read the videos from the SD card, but that would also mean that the video downloaded could be extracted from the sd card very easily( and for security reasons I can't allow that to happen) is that how it would work !? – bytebiscuit Sep 27 '11 at 14:35
  • http://stackoverflow.com/questions/6303365/need-help-in-downloading-in-background-images-in-android/6326839#6326839 – slayton Sep 27 '11 at 14:36
  • Thanks a lot for the link. Out of curiosity, is there any other way of handling this, or is the download-from-server the only way? – bytebiscuit Sep 27 '11 at 14:42
  • Another option would be to split the media files into 2 or 3 companion apps. This isn't a good options as it would require all the companion apps to be installed before your app can work. The user has to download the content somehow. – slayton Sep 27 '11 at 14:46
  • True. How about compressing the videos and decreasing the size is that possible? As I have multiples videos of 3-10 MB in size. – bytebiscuit Sep 27 '11 at 14:51
  • That is a great idea for downloading the data, but I wouldn't package the compressed files with the app. After you uncompress them you'll be wasting the space that is occupied by the compressed files. You cannot delete resources after an APK has been compiled, so you'd still be wasting the space. – slayton Sep 27 '11 at 14:54
  • Hang on, so Android uncompresess the data automatically. And let's say I compress these videos, would I be able to play them from the raw folder ? – bytebiscuit Sep 27 '11 at 15:06
  • You would probably have to handle the decompression yourself. For performance reasons you don't want to decompress the files when they are needed so you'll have to store the files twice on the device. Once in the compressed form and another copy in the uncompressed form. This is a really bad idea b/c then you're using even more of the phone's storage space. – slayton Sep 27 '11 at 15:08
  • will Android know that the files are compressed, I mean if you compressed with a third party program then will they be treated as normal video files!!! – bytebiscuit Sep 27 '11 at 15:13
  • No. because they won't be video files anymore they will be compressed video files. – slayton Sep 27 '11 at 15:16
  • Damn. So the only proper solution for this, would be to just download the files in the beginning and save them on the sd card and then play them from there.!! Damn, this will add costs as I need to get hosting server now !! – bytebiscuit Sep 27 '11 at 15:21
  • One other thing about the download part. I want to keep the downloaded files secure and since the files that I'm going to download are going to be stored in the SD card they're not going to be secure. So I was wondering if it's possible to actually download and store them in the private local rep of the app rather than on the sd card ?? – bytebiscuit Sep 28 '11 at 10:31
0

Well, if you're sure you need all this content inside your application, the only solution I see is to download the content from a server when the application is opened for the first time. But as a user I think I won't be very happy to have a 150 Mb application on my phone. Do you really need all this data?

Egor
  • 39,695
  • 10
  • 113
  • 130