Index: www/install.wiki ================================================================== --- www/install.wiki +++ www/install.wiki @@ -16,13 +16,13 @@ along with the other application code.

By default, the SQLite Android bindings support Android API levels 16 and greater (Android versions 4.1 and up). There is also a separate version -that supports Android API levels 15 and greater (Android version 4.0.2 and +that supports Android API levels 9 and greater (Android version 2.3 and up). Please note the extra step involved in [#obtaincode|obtaining the code] -if you wish to use the version compatible with API level 15. +if you wish to use the version compatible with API level 9.

1. Using a Pre-Built aar File

This is the most straightforward option. An "aar" file is similar to a @@ -92,58 +92,59 @@ zip archive. In this case, the "project directory" is the SQLite_Android_Bindings/ directory created by unzipping the downloaded archive.

- API level 15 users: The code for the version that is - compatible with Android API level 15 may be obtained as a zip + API level 9-15 users: The code for the version that is + compatible with Android API level 9 and greater may be obtained as a zip file - from here. + from here. Or, if using fossil, the fossil open command above should be replaced with: - $ fossil open ../android.fossil api-level-15 + $ fossil open ../android.fossil api-level-9 + +

  • Configure the native libraries. +

    + The latest release of the public domain SQLite library is bundled + with the SQLite Android bindings code downloaded in step 1. If you wish + to use a different version of SQLite, for example one that contains the + proprietry [./see.wiki | SEE extension], then replace the sqlite3.c + and sqlite3.h files at the following locations: + + sqlite3/src/main/jni/sqlite/sqlite3.c + sqlite3/src/main/jni/sqlite/sqlite3.h +

    + By default, SQLite is built with the following options: + + -DSQLITE_ENABLE_FTS5 + -DSQLITE_ENABLE_RTREE + -DSQLITE_ENABLE_JSON1 + -DSQLITE_ENABLE_FTS3 + To build the SQLite library with some other combination of command line + switches, edit the Android.mk file at this location: + + sqlite3/src/main/jni/sqlite/Android.mk -

  • Build the native libraries. +
  • Build the native libraries. +

    +This step is optional. It will be run automatically by the +gradlew command in step 4. Running it separately +is primarily useful for for debugging broken builds.

    To build the native libraries, navigate to the sqlite3/src/main/ directory of the project directory and run the ndk-build command. For example, on Linux if Android Studio and the NDK are installed using their default paths: $ cd sqlite3/src/main $ ~/Android/Sdk/ndk-bundle/ndk-build -

    On modern hardware, this command takes roughly 2 minutes to build the +

    On modern hardware, this command takes roughly 3 minutes to build the native libraries for all Android architectures. -

    - The latest release of the public domain SQLite library comes bundled - with the SQLite Android bindings code downloaded in step 1. If you wish - to use a different version of SQLite, for example one that contains the - proprietry [./see.wiki | SEE extension], then replace the sqlite3.c - and sqlite3.h files at the following locations before running - the ndk-build command: - - - sqlite3/src/main/jni/sqlite/sqlite3.c - sqlite3/src/main/jni/sqlite/sqlite3.h -

    - If you wish to build the SQLite library with non-standard command line - switches, for example the -DSQLITE_ENABLE_FTS5 switch used to enable - FTS5, they should be added to - the Android.mk file at this location: - - - sqlite3/src/main/jni/sqlite/Android.mk -

    - If the Android.mk or sqlite3.[ch] files - are edited after ndk-build is run, it may be necessary to run - the ndk-build clean command before rerunning - ndk-build to ensure a correct build. -

    - Once ndk-build has been run successfully, unless you modify - the Android.mk or sqlite3.[ch] files, - it should not be necessary to run it again. It does not have to be - run each time the application is rebuilt. +

    + If the Android.mk file is edited after ndk-build is + run, it may be necessary to run the ndk-build clean command + before rerunning ndk-build to ensure a correct build.

  • Assemble the aar file. To assemble the aar file using the command line, first set environment variable ANDROID_HOME to the SDK directory, then run the gradle "assembleRelease" target from within the "sqlite3" sub-directory of the project directory. For example: @@ -164,10 +165,15 @@ Studio application as described above. The aar file should be roughly 4.5MB in size. If it is much smaller than this (closer to 100KB), this indicates that the aar file is missing the native libraries. The usual cause of this is an unnoticed error while building the native libraries (step 2 above). +

    + If the Android.mk file described in step 2 above is edited + after a build has been run, it may be necessary to run the + gradle "clean" target (either with ../gradlew clean or through + Android Studio) before rebuilding the aar file to ensure a correct build.

    3. Adding Source Code Directly to the Application