I’m using ORMLite in my android application. Is there a way when creating the database in the database helper to add some rows, or I must check in the main activity if there is already a database created and then create it and populate it if it doesn’t exists.
What I want to achieve: When the application starts for the first time, add some data in the database (when creating the database file).
I’m using ORMLite in my android application. Is there a way when creating the
Share
You can certainly add as much as you like in the
onCreateoronUpgrademethods. Once you create the table, generate a DAO and dodao.create(...);.If you look at the
HelloAndroidexample application, you can see that it does exactly that.