2014-09-28 202 views
1

我發展我的第一個應用程序,並使用下面的代碼,我看到的是我的SQLite版本:如何升級SQLite版本?

Cursor cursor = SQLiteDatabase.openOrCreateDatabase(":memory:", null).rawQuery("select sqlite_version() AS sqlite_version", null); 
String sqliteVersion = ""; 
while(cursor.moveToNext()) 
    sqliteVersion += cursor.getString(0); 
Log.e("Version", sqliteVersion); 

我的版本是3.7.11。

因爲我需要使用一些新的功能,如何升級到最新版本?

回答

1

您使用SQLiteDatabase訪問的SQLite庫是Android的一部分,無法替換(除非您在根設備上重新編譯Android)。

你必須compile your own copy of SQLite with the NDK並通過你自己的包裝函數/對象訪問它。

+0

即使我在我的手機上做到了,如何讓我的應用程序兼容所有設備?所以SQLite的版本與手機有關,我認爲我依賴Android SDK ... – smartmouse 2014-09-28 18:37:46

+0

你用NDK編譯的東西可以讓你的應用獲得更多的好處。 – 2014-09-28 19:06:27