Question

Is it possible to load table creation scripts from flat files when creating the SQLite database in Android?

I am going to have multiple tables and all the examples I have seen online using the SQLite helper classes, include the script text in the Java file and I'd rather not clutter up my class.

Was it helpful?

Solution

Yes. The same as with copying file from assets (https://gist.github.com/1271795) you can read file and execute commands on newly created SQLiteDatabase.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top