Question

I am in need to write an application for Android devices that needs to access a large (~200MB) database. What would be the best way to do this? Can I just stick the database in the assets folder? I have read of various limitations that apply to the entire application size and to individual resources within, especially on some devices... What are exactly these limits?

Is there any way to do this apart from a post-installation download from an external server?

Was it helpful?

Solution

The G1 has 256MB of internal storage for applications. Even on the Nexus One there's only 512MB so I think it's unlikely that anyone would want a single application taking up such a high proportion of this storage, so creating a 200MB+ .apk file isn't going to be practical.

Your options are probably:

  • Make the database accessible via a webservice so your app can query it over an Internet connection.
  • Download the data bit-by-bit on an as needed basis and cache it on the SD Card.
  • Download the database to the SD Card on the first run of your applicaton.

I think the last of these is least preferable, as a 200MB download is going to take a long time, and might use a significant chunk of someone's 3G monthly data allowance. If you are going to do this it may be worth checking the status of the phone so you only download when there's a wi-fi connection.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top