Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying large database with Android application

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?

like image 436
Dnap Avatar asked Dec 22 '22 05:12

Dnap


1 Answers

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.

like image 122
Dave Webb Avatar answered Dec 24 '22 19:12

Dave Webb