I\'m using ORMLite in an android project, and I\'m not wanting to use the extended activities because I\'m inserting values into the database on an AsyncTask.
In the
I could nitpick but essentially you are doing it correct.
The call
dbHelper = (DBHelper) OpenHelperManager.getHelper(context, DBHelper.class);
Looks up the DBHelper
class and instantiates it for the context. If you have defined it in your strings.xml, you can leave off the DBHelper.class at the end.
onUpgrade
in you DBHelper.java
, you may want to consider dropping the table you create in onCreate
and then calling onCreate
(to make sure you don't have conversion issues from update to update). You could do a more complex update if you wanted.
Other than that, it looks good. If you end up wanting data accessory methods for your DB objects beyond the base DAO methods, you will eventually want to create more thorough implementations of your object DAOs, but this is a good start.