I use a database in ormlite. I would like to get the version of my database in the Activity, but I don’t know in wich table is saving the version.
Anybody know how can I get the version of the database? I have looked for in the manuals but I haven’t found it.
Thanks a lot.
If you are talking about the database version number managed by the Android OS then you will know what the number is because otherwise you will get a call to
onUpgrade(...).If your
onUpgrade(...)method is called, you know what the number is because you get the old version and the new version numbers. If you didn’t get the call then you know that the version number you set in your database helper and was passed up to theSQLiteOpenHelperclass corresponds to the one in the Android’s storage.Here’s a sample of code from a typical ORMLite
DatabaseHelperclass: