Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prepopulate a Green DAO sqlite database

I am about to use the Green DAO ORM tool. I am going to have to insert about six hundreds rows of data into my database. I am wondering there is a way to prepopulate the database using some form of sqlite database management tool or a script. I dont want to manually add each of these entities and so on. in android code. It would be too tedious and time consuming.

like image 694
Joel Dean Avatar asked Oct 05 '22 15:10

Joel Dean


1 Answers

Put your data in a CSV/JSON file. Then on the onCreate method of your DBHelper, read the file and insert them into your database.

like image 66
dannyroa Avatar answered Oct 13 '22 11:10

dannyroa