2012-12-13 30 views
0

如何使用Android 2.2的SQLite 3.7.4? 因爲,任何查詢不適用於android 2.2,但工作蜂窩,ICS。 請幫幫我。Sqlite 3.7.4與Android 2.2

這是我的查詢:

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此查詢工作。

我看了thisthis後。

+2

你所說的「任何疑問並沒有在Android 2.2的工作」是什麼意思? – wtsang02

+0

@ wtsang02我編輯了我的問題,你明白嗎? –

+0

一個事實是,我們不知道你的表的樣子,你怎麼寫你的代碼中使用此查詢,所以請添加您的代碼。 – wtsang02

回答

2

您不能更改設備固件中的SQLite版本。它就是這樣,並且this SO answer擁有不同版本的好名單。

你可以試試SQLCipher for Android,我認爲它基於比3.7.4更新版本的SQLite,並且如果你願意,它可以給你加密。但它會爲你的APK大小增加幾MB。

否則,您將需要重新修改您的架構和查詢的東西,在老版本的SQLite成功的作品,或停止支持那些有太舊版本的SQLite的較舊的Android版本。