我可以通过Jetpack在项目中使用新版本的sqlite吗? [英] Can i use a newer version of sqlite in my project through Jetpack?

查看:97
本文介绍了我可以通过Jetpack在项目中使用新版本的sqlite吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经达到要在android中使用"lead"和"lag"函数的条件,但是除非您的sqlite版本至少为3.2,否则它们将不起作用.我们的项目是否可以通过Jetpack使用较新的sqllite版本,如果可以,如何使用?

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?

推荐答案

我们的项目是否可以通过Jetpack使用较新的sqllite版本

Is it possible for our project to use the newer sqllite versions through Jetpack

Jetpack不会直接为您提供新的SQLite版本.

Jetpack does not directly give you a new SQLite version.

但是,如果您使用的是Room,则可以使用SupportSQLiteDatabase系列接口的自定义实现.默认情况下,Room使用其自己的Framework...版本,该版本使用内置的SQLite.但是,在您的Room.DatabaseBuilder上,您可以调用openHelperFactory()并提供使用另一种实现的SupportSQLiteOpenHelper.Factory.

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.

您至少可以使用其中两个,它们是在相当最新的SQLite版本上使用的:

There are at least two of these that you could use, that are on fairly current versions of SQLite:

适用于Android的SQLCipher ,现在通过我的 CWAC-SafeRoom库

两者都要求您将SQLite的二进制文件与您的应用程序打包在一起(对于Android的SQLCipher,则打包为加密库).这样会大大增加APK的大小.

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.

这篇关于我可以通过Jetpack在项目中使用新版本的sqlite吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆