SQLite Android Bindings

Check-in [1ca2ebe562]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Update build documentation to match previous commit.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | upgrade
Files: files | file ages | folders
SHA1: 1ca2ebe5628f146cad8e86f1b53f386ac986cb37
User & Date: dan 2020-07-02 15:48:58
Context
2020-07-02
15:50
Upgrade this project to more modern Android dependencies. This patch is from Heath Borders on the mailing list. (Leaf check-in: a742d49c4c user: dan tags: trunk)
15:48
Update build documentation to match previous commit. (Closed-Leaf check-in: 1ca2ebe562 user: dan tags: upgrade)
15:09
Upgrade this project to more modern Android dependencies. This patch is from Heath Borders on the mailing list. (check-in: 6137b7dfd2 user: dan tags: upgrade)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to sqlite3/build.gradle.

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
    //sourceSets.main.jni.srcDirs = [] //disable automatic ndk-build call
    externalNativeBuild {
        ndkBuild {
            path 'src/main/jni/Android.mk'
        }
    }

    ndkVersion "21.3.6528147"

    useLibrary 'android.test.base' // for android.test.AndroidTestCase
    useLibrary 'android.test.runner' // for android.test.MoreAsserts
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')







|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
    //sourceSets.main.jni.srcDirs = [] //disable automatic ndk-build call
    externalNativeBuild {
        ndkBuild {
            path 'src/main/jni/Android.mk'
        }
    }

    ndkVersion '21.3.6528147'

    useLibrary 'android.test.base' // for android.test.AndroidTestCase
    useLibrary 'android.test.runner' // for android.test.MoreAsserts
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')

Changes to www/install.wiki.

121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
...
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
    -DSQLITE_ENABLE_JSON1
    -DSQLITE_ENABLE_FTS3</verbatim>
  To build the SQLite library with some other combination of command line
  switches, edit the <code>Android.mk</code> file at this location:
<verbatim>
    sqlite3/src/main/jni/sqlite/Android.mk</verbatim>

<li><a name=buildnative2></a> <b>Build the native libraries.</b>
<p>
This step is <b>optional. It will be run automatically by the
</b><code>gradlew</code><b> command in step 4.</b> Running it separately
is primarily useful for for debugging broken builds.
  <p> To build the native libraries, navigate to the
      <code>sqlite3/src/main/</code> directory of the project directory and
      run the <code>ndk-build</code> command. For example, on Linux if 
      Android Studio and the NDK are installed using their default paths:
<verbatim>
    $ cd sqlite3/src/main
    $ ~/Android/Sdk/ndk-bundle/ndk-build</verbatim>
  <p> On modern hardware, this command takes roughly 3 minutes to build the
      native libraries for all Android architectures.
  <p>
  If the <code>Android.mk</code> file is edited after <code>ndk-build</code> is
  run, it may be necessary to run the <code>ndk-build clean</code> command
  before rerunning <code>ndk-build</code> to ensure a correct build.

  <li> <b>Assemble the aar file</b>. 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:
<verbatim>
    $ export ANDROID_HOME=~/Android/Sdk/
    $ cd sqlite3
    $ ../gradlew assembleRelease</verbatim>
................................................................................
  <p>
  Using either the command line or Android Studio to run the gradle task
  causes the aar file to be created at:
  <code>sqlite3/build/outputs/aar/sqlite3-release.aar</code>.
  <p>
  Once the custom aar file has been created, it may be used in an Android
  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).
  <p>
  If the <code>Android.mk</code> 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 <code>../gradlew clean</code> or through
  Android Studio) before rebuilding the aar file to ensure a correct build.
</ol>








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|







 







|
|
|
<







121
122
123
124
125
126
127



















128
129
130
131
132
133
134
135
...
140
141
142
143
144
145
146
147
148
149

150
151
152
153
154
155
156
    -DSQLITE_ENABLE_JSON1
    -DSQLITE_ENABLE_FTS3</verbatim>
  To build the SQLite library with some other combination of command line
  switches, edit the <code>Android.mk</code> file at this location:
<verbatim>
    sqlite3/src/main/jni/sqlite/Android.mk</verbatim>




















  <li> <b>Build and Assemble the aar file</b>. 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:
<verbatim>
    $ export ANDROID_HOME=~/Android/Sdk/
    $ cd sqlite3
    $ ../gradlew assembleRelease</verbatim>
................................................................................
  <p>
  Using either the command line or Android Studio to run the gradle task
  causes the aar file to be created at:
  <code>sqlite3/build/outputs/aar/sqlite3-release.aar</code>.
  <p>
  Once the custom aar file has been created, it may be used in an Android
  Studio application as described above. The aar file should be roughly
  3.2MB in size. If it is much smaller than this (closer to 100KB), this
  indicates that the aar file is missing the native libraries for one
  reason or another. Consult the build logs.

  <p>
  If the <code>Android.mk</code> 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 <code>../gradlew clean</code> or through
  Android Studio) before rebuilding the aar file to ensure a correct build.
</ol>