Android Question SQLite - create and ship?

Tony Tetley

Member
Licensed User
Longtime User
Hello, is it possible to create an SQLite DB with something like http://www.sqliteexpert.com/ and then include it with the app install package? Do you place it in the Files list which includes it in the .DirAssets or some other method?

Thanks,
Tony
 

keirS

Well-Known Member
Licensed User
Longtime User
It's not good practice to do this. SQLite expert uses version 3.8.x of the SQLite library. Android uses SQLite versions from 3.5.x to 3.8.x depending on the version of Android. Only Lollipop uses 3.8.x. SQLite only supports backwards compatibility so SQLite 3.6.x might not be able to read a 3.8.x database.
 
Upvote 0

keirS

Well-Known Member
Licensed User
Longtime User
Never had a problem with SQLite expert even with the very first tab7

From the SQLite documentation

SQLite Documentation said:
You can tell if you should reload your databases by comparing the version numbers of the old and new libraries. If the first digit of the version number is different, then a reload of the database will be required. If the second digit changes, newer versions of SQLite will be able to read and write older database files, but older versions of the library may have difficulty reading or writing newer database files. For example, upgrading from version 2.8.14 to 3.0.0 requires a reload. Going from version 3.0.8 to 3.1.0 is backwards compatible but not necessarily forwards compatible.

Try a SQLite DB that uses foreign key constraints on a device running Eclair. I can guarantee it will f**k up.
 
Upvote 0
Top