0

如何在 android 2.2 中使用 sqlite 3.7.4?因为,任何查询都不能在 android 2.2 上工作,但可以工作蜂窝,ICS。请帮我。

这是我的查询:

select snippet(content,'<b>','</b>','...',-1) as mytext,docid as _id from content where text match 'book*'"


public Cursor getSearchResult(String str) {
    String query = new StringBuilder().append("select snippet(content,'<b>','</b>','...',-1) as mytext,docid as _id from content where").append(" text match '").append(str).append("*'").toString();
    return database.rawQuery(query, null);
}

我正在使用 fts3 表。

日志:

android.database.sqlite.SQLiteException: SQL logic error or missing database

此查询适用于 ICS。

我读了这个这篇文章。

4

1 回答 1

2

您无法更改设备固件中的 SQLite 版本。就是这样,这个 SO 答案有一个很好的名单,说明了它对于不同版本的含义。

您可以尝试SQLCipher for Android,我认为它基于比 3.7.4 更新的 SQLite 版本,如果您愿意,它可以为您提供加密。但它会为您的 APK 大小增加几 MB。

否则,您将需要将架构和查询重新设计为在旧 SQLite 版本上成功运行的内容,或者停止支持具有太旧 SQLite 版本的旧 Android 版本。

于 2012-12-13T01:21:24.610 回答