0

How to use sqlite 3.7.4 with android 2.2? Because, any queries doesn't work on android 2.2, but work honeycomb,ICS. Please help me.

This is my query:

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);
}

I'm using fts3 table.

Log:

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

This query work on ICS.

I read this and this post.

Community
  • 1
  • 1
Sardor Dushamov
  • 1,665
  • 3
  • 17
  • 44

1 Answers1

2

You cannot change the version of SQLite that is in the firmware of the device. It is what it is, and this SO answer has a nice roster of what it is for different versions.

You could try SQLCipher for Android, which I think is based on a newer version of SQLite than 3.7.4, and it gives you encryption if you want it. But it will add a few MB to your APK size.

Otherwise, you will need to rework your schemas and queries to something that works successfully on older SQLite versions, or stop supporting the older Android versions that have a too-old version of SQLite.

Community
  • 1
  • 1
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491