views:

2057

answers:

2

I am working on an android app that needs to act on a few data files totaling around 30MB. I put together a test and the emulator failed with OutOfDiskSpace. Debugging on a device failed with even a smaller data size. After reading through the google groups, it appears that the application size limit isn't stated anywhere and nobody from google has been forthcoming with specifics about this. Given that there are iPhone apps that are over 100MB in size, putting such a small limit on Android apps seems weird, except just for the fact that you have a relatively small amount of total available app storage space (< 100MB).

Now for my question:

What techniques do you use to deal with this limit? If you have an app that needs more than 10MB, do you put it on a web server and deal with downloading it the first time? If so, how do you handle access control so that only your app can get the data?

A: 

Sounds like you are trying to load some large file into memory - that's never scalable. Use a streaming model to process the file in chunks, or compress the contents if you need the entire thing. If you are serving it from a web server/service just serve the parts the app needs right then, rather then the whole file.

Gandalf
Thats not the problem at all. The problem is finding a good technique accessing the data needed. The entire app is never loading into memory, but the total size is restricted as to what you can even copy to the app space.
AdamC
+7  A: 

The common technique is the download the data when the application is first ran and save the data to the SD card. this is because internal memory is a scarce commodity with the current state of Android. Installing apps to the sd card is not officially supported and internal memory on the HTC Dream and Sapphire is lacking.

Here is a link to a thread on the official android-developers group where a Google Android Engineer (Dianne Hackborn) responds to this very question with

The best solution right now is I think to download your large data after installing.

snctln
Why the down vote? It seems to me that the question is how do I make an application with a large amount of data? Right now the way to do it is to put the base application on the Android Market and then download the large files (audo/video/zipped databses) on the first run on the application, saving these large files to the SD card so that you don't run out of space on the actual device. Is this not the question?
snctln