@@ -82,6 +82,8 @@ sqlite3_close(db)
8282### Android Package
8383
8484You can [ add this project as a dependency to your Android project] ( https://central.sonatype.com/artifact/ai.sqlite/vector ) .
85+
86+ ** build.gradle (Groovy):**
8587``` gradle
8688repositories {
8789 google()
@@ -90,11 +92,32 @@ repositories {
9092}
9193
9294dependencies {
95+ // ...
9396
94- ...
95-
97+ // Use requery's SQLite instead of Android's built-in SQLite to support loading custom extensions
9698 implementation 'com.github.requery:sqlite-android:3.49.0'
97- implementation 'ai.sqlite:vector:0.9.32' // or 'com.github.sqliteai:sqlite-vector:0.9.32'
99+ // Both packages below are identical - use either one
100+ implementation 'ai.sqlite:vector:0.9.32' // Maven Central
101+ // implementation 'com.github.sqliteai:sqlite-vector:0.9.32' // JitPack (alternative)
102+ }
103+ ```
104+
105+ ** build.gradle.kts (Kotlin):**
106+ ``` kotlin
107+ repositories {
108+ google()
109+ mavenCentral()
110+ maven(url = " https://jitpack.io" )
111+ }
112+
113+ dependencies {
114+ // ...
115+
116+ // Use requery's SQLite instead of Android's built-in SQLite to support loading custom extensions
117+ implementation(" com.github.requery:sqlite-android:3.49.0" )
118+ // Both packages below are identical - use either one
119+ implementation(" ai.sqlite:vector:0.9.32" ) // Maven Central
120+ // implementation("com.github.sqliteai:sqlite-vector:0.9.32") // JitPack (alternative)
98121}
99122```
100123
@@ -103,6 +126,7 @@ After adding the package, you'll need to [enable extractNativeLibs](https://gith
103126Here's an example of how to use the package:
104127``` java
105128import android.database.Cursor ;
129+ import android.util.Log ;
106130import io.requery.android.database.sqlite.SQLiteCustomExtension ;
107131import io.requery.android.database.sqlite.SQLiteDatabase ;
108132import io.requery.android.database.sqlite.SQLiteDatabaseConfiguration ;
@@ -122,17 +146,17 @@ import java.util.Collections;
122146 );
123147
124148 SQLiteDatabase db = SQLiteDatabase . openDatabase(config, null , null );
125-
149+
126150 Cursor cursor = db. rawQuery(" SELECT vector_version()" , null );
127151 if (cursor. moveToFirst()) {
128152 String version = cursor. getString(0 );
129- resultTextView . setText( " vector_version(): " + version);
153+ Log . i( " sqlite-vector " , " vector_version(): " + version);
130154 }
131155 cursor. close();
132156 db. close();
133157
134158 } catch (Exception e) {
135- resultTextView . setText( " ❌ Error: " + e. getMessage());
159+ Log . e( " sqlite-vector " , " Error: " + e. getMessage());
136160 }
137161 }
138162```
0 commit comments