summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mark Lu <marklu@google.com> 2016-09-26 17:47:26 +0000
committer android-build-merger <android-build-merger@google.com> 2016-09-26 17:47:26 +0000
commit56ae75bd81e890bdee126acfc9544ee6ef69eddc (patch)
treec795f00ff9ea6652ad82da2eb3562af597b6a579
parentb2a58fe512d367c80ff2a9d115b8110d69932dd6 (diff)
parentfd4f71e3c3a9f0135650f754ae6298bc289413d8 (diff)
docs: improve docs for sqlite package summary am: 59640a9f1c am: e9480d08d3
am: fd4f71e3c3 Change-Id: I87bddc7048ca2c5d086662d2d258060905ebc8e6
-rw-r--r--core/java/android/database/sqlite/package.html49
1 files changed, 39 insertions, 10 deletions
diff --git a/core/java/android/database/sqlite/package.html b/core/java/android/database/sqlite/package.html
index ceed171ce48c..864a9bb32702 100644
--- a/core/java/android/database/sqlite/package.html
+++ b/core/java/android/database/sqlite/package.html
@@ -6,15 +6,44 @@ classes that an application would use to manage its own private database.
Applications use these classes to manage private databases. If creating a
content provider, you will probably have to use these classes to create and
manage your own database to store content. See <a
-href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a> to learn
-the conventions for implementing a content provider. See the
-NotePadProvider class in the NotePad sample application in the SDK for an
-example of a content provider. Android ships with SQLite version 3.4.0
-<p>If you are working with data sent to you by a provider, you will not use
-these SQLite classes, but instead use the generic {@link android.database}
-classes.
-<p>Android ships with the sqlite3 database tool in the <code>tools/</code>
-folder. You can use this tool to browse or run SQL commands on the device. Run by
-typing <code>sqlite3</code> in a shell window.
+href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers</a>
+to learn the conventions for implementing a content provider. If you are working
+with data sent to you by a provider, you do not use these SQLite classes, but
+instead use the generic {@link android.database} classes.
+
+<p>The Android SDK and Android emulators both include the
+<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>.
+
+<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 24</td><td>3.9</td></tr>
+ <tr><td>API 21</td><td>3.8</td></tr>
+ <tr><td>API 11</td><td>3.7</td></tr>
+ <tr><td>API 8</td><td>3.6</td></tr>
+ <tr><td>API 3</td><td>3.5</td></tr>
+ <tr><td>API 1</td><td>3.4</td></tr>
+</table>
+
+<p>Some device manufacturers include different versions of SQLite on their devices.
+ There are two ways to programmatically determine the version number.
+
+<ul>
+ <li>If available, use the sqlite3 tool, for example:
+ <code>adb -e 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);
+ }</pre>
+ </li>
+</ul>
</BODY>
</HTML>