0

I have an app that just need to read from a database. I do not want to parse a big file in the app because it takes a lot of memory.

So is it possible to populate a database and ship it with the app?

Just parsing the file and storing it in the app the first time the app is run will not do since it will create the same memory problem.

An alternative would be to have the database on Google Appengine but I would like to avoid that because the app would be unusable if there is no internet connection and there are costs for the traffic.

1 Answers1

0

So is it possible to populate a database and ship it with the app?

Yes. Create a SQLite database containing your data, then package it with your app using SQLiteAssetHelper. It will be unpacked into position when you first try to use the database.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491