diff options
| author | 2023-09-25 21:46:08 +0000 | |
|---|---|---|
| committer | 2023-09-25 21:46:08 +0000 | |
| commit | 4df32c8c35352c1d457cb68a24392726e5088b3b (patch) | |
| tree | c4594b7676daa04b74fc3e7e261f861b5a06f7b9 | |
| parent | 28805c7b4b6cbe51510b95f89e22b2290952b810 (diff) | |
| parent | 7fb5f474b4f94ac5d0b90b4b1211feb1ba15e7c7 (diff) | |
Merge "Update the SQLite API version table" into udc-dev am: 7fb5f474b4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24839684
Change-Id: Ia141d431e29406fd827939859f743494842d90fe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | core/java/android/database/sqlite/package.html | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/core/java/android/database/sqlite/package.html b/core/java/android/database/sqlite/package.html index 6ececa2e1416..e58798354d3c 100644 --- a/core/java/android/database/sqlite/package.html +++ b/core/java/android/database/sqlite/package.html @@ -15,11 +15,14 @@ instead use the generic {@link android.database} classes. <a href="{@docRoot}studio/command-line/sqlite3.html">sqlite3</a> command-line database tool. On your development machine, run the tool from the <code>platform-tools/</code> folder of your SDK. On the emulator, run the tool -with adb shell, for example, <code>adb -e shell sqlite3</code>. +with adb shell, for example, <code>adb shell sqlite3</code>. <p>The version of SQLite depends on the version of Android. See the following table: <table style="width:auto;"> <tr><th>Android API</th><th>SQLite Version</th></tr> + <tr><td>API 34</td><td>3.39</td></tr> + <tr><td>API 33</td><td>3.32</td></tr> + <tr><td>API 32</td><td>3.32</td></tr> <tr><td>API 31</td><td>3.32</td></tr> <tr><td>API 30</td><td>3.28</td></tr> <tr><td>API 28</td><td>3.22</td></tr> @@ -38,15 +41,19 @@ with adb shell, for example, <code>adb -e shell sqlite3</code>. <ul> <li>If available, use the sqlite3 tool, for example: - <code>adb -e shell sqlite3 --version</code>.</li> + <code>adb shell sqlite3 --version</code>.</li> <li>Create and query an in-memory database as shown in the following code sample: <pre> String query = "select sqlite_version() AS sqlite_version"; SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(":memory:", null); Cursor cursor = db.rawQuery(query, null); String sqliteVersion = ""; - if (cursor.moveToNext()) { - sqliteVersion = cursor.getString(0); + try { + if (cursor.moveToNext()) { + sqliteVersion = cursor.getString(0); + } + } finally { + cursor.close(); }</pre> </li> </ul> |