1

I'm writing an app which will rely heavily on the use of a database. This database will have two "bigger" tables (50rows*70columns and 200rows*20columns) and 5 or 6 smaller tables. The app will need to access, read and edit the database.

Now, I'm having doubts about whether I should create the database programatically at runtime or using a prepopulated one on the assets folder. Considering the size of the database described in the first paragraph, which method do you think brings more advantages?

Thank you.

tyb
  • 4,749
  • 11
  • 31
  • 38

2 Answers2

3

I am a fan of shipping my apps with a pre-populated database if the data is not dynamic. Why parse a text file and do a bunch of inserts if you can just copy the database from your assets folder?

Here is a guide to do it yourself
Here is a nice helper class if you would rather use proven code

JustinMorris
  • 7,259
  • 3
  • 30
  • 36
1

Prepopulated is the best practice in such conditions. How to use the prepopulated database? see this.

Community
  • 1
  • 1
Yaqub Ahmad
  • 27,569
  • 23
  • 102
  • 149