diff --git a/core/java/android/database/sqlite/package.html b/core/java/android/database/sqlite/package.html index ceed171ce48c2..864a9bb32702e 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 Content Providers 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 -
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. -
Android ships with the sqlite3 database tool in the tools/
-folder. You can use this tool to browse or run SQL commands on the device. Run by
-typing sqlite3 in a shell window.
+href="{@docRoot}guide/topics/providers/content-providers.html">Content Providers
+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.
+
+
The Android SDK and Android emulators both include the
+sqlite3 command-line
+database tool. On your development machine, run the tool from the
+platform-tools/ folder of your SDK. On the emulator, run the tool
+with adb shell, for example, adb -e shell sqlite3.
+
+
The version of SQLite depends on the version of Android. See the following table: +
| Android API | SQLite Version |
|---|---|
| API 24 | 3.9 |
| API 21 | 3.8 |
| API 11 | 3.7 |
| API 8 | 3.6 |
| API 3 | 3.5 |
| API 1 | 3.4 |
Some device manufacturers include different versions of SQLite on their devices. + There are two ways to programmatically determine the version number. + +
adb -e shell sqlite3 --version.
+ 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);
+ }
+