Вопрос

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.

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top