I have a big text file containing SQL CREATE TABLE and INSERT statements. How do I import this file in the SQLiteOpenHelper onCreate method?
Or, is there an accepted way of using the binary database file directly?
I need this to be compatible with Android 1.6.
In the SQLiteOpenHelper onCreate() method you can just use
db.execSQL(...)but that depends on how your ‘text file’ is structured (and how big it is).Alternatively, you can ‘ship’ a SQLite db with your app – see this link to give you some ideas…
Using your own SQLite database in Android applications