问题
We have come to a condition where we want to use the "lead" and "lag" functions in android but they don't function unless your sqlite version is at least 3.2. Is it possible for our project to use the newer sqllite versions through Jetpack, and if so, how?
回答1:
Is it possible for our project to use the newer sqllite versions through Jetpack
Jetpack does not directly give you a new SQLite version.
However, if you are using Room, you can use a custom implementation of the SupportSQLiteDatabase family of interfaces. By default, Room uses its own Framework... versions, which use the built-in SQLite. But, on your Room.DatabaseBuilder, you can call openHelperFactory() and supply a SupportSQLiteOpenHelper.Factory that uses another implementation.
There are at least two of these that you could use, that are on fairly current versions of SQLite:
https://github.com/requery/sqlite-android
SQLCipher for Android, right now by way of my CWAC-SafeRoom library
Both require you to package binaries of SQLite with your app (and cryptography libraries in the case of SQLCipher for Android). This will significantly increase the size of your APK.
来源:https://stackoverflow.com/questions/56385304/can-i-use-a-newer-version-of-sqlite-in-my-project-through-jetpack