I have a sqlite database in my application. My application shouldn’t ship this as an empty database but certain records need to be created before the user can use the application the first time. Of course I can have many insert statements, but that seems to be very strange. I thought of something like http://vineetyadav.com/tutorials/11-adding-prefilled-sqlite-database-to-android-app.html which basically works, but that means that my manually created DB needs all internal tables like android_metadata as well. So I either need to know what internal tables exist and how to fill them. Or another smart way of having a pre-filled database. Any suggestions?
Thanks, A.
You could read in a flat file from the SD card with 1 insert statement per line and iterate through that file.
Here’s a similar example in which I read a file and add a ContactItem to my contact_list: