views:

139

answers:

1

I am unable to find out this information in the db file. where does exactly android store database version info?

+6  A: 

You can read the version using android.database.sqlite.SQLiteDatabase.getVersion().

Internally, this method executes the SQL statement "PRAGMA user_version". I got that from the Android source code.

In the database file, the version is stored at byte offset 60 in the database header of the database file, in the field 'user cookie'.

Thomas Mueller
that was useful, but my question is where does this version info get stored on the filesystem (or may be in database file)?
bhups
It's stored in the database header (I updated my answer).
Thomas Mueller