How to ship an Android application with a database?

Total Post:135

 1125  View(s)
Rate this:

If your application requires a database, and comes with built in data, what is the best way to ship that application?

1) Precreate the sqlite database and include it in the apk?

2) Include the SQL commands with the application and have it create the database and insert the data on first use?

The drawbacks I see

1) Possible sqlite version mismatches might cause problems, and I currently don't know where the database should go and how to access it.

2) It may take a really long time to create and populate the database on the device.

Your thoughts? Pointers to documentation regarding any issues would be great.