My app uses a database, it comes pre-populated with about 50 values. I’m accomplishing this by doing about 50 db.execSQL(“INSERT INTO…. statements in the onCreate section of my DbHelper class.
I was wondering if there was a more ideal way to handle the insertion of initial values or if this was perfectly acceptable.
You can add more than one value set at the same time into a single table:
This will perform much faster and be more concise!
Also you may want to consider loading this data from a properties file or similar so it’s more easily changed should those initial values ever vary.