Can i use a newer version of sqlite in my project through Jetpack?

独自空忆成欢 提交于 2019-12-13 03:34:31

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!