Skip to content

Commit 335ba51

Browse files
committed
chore: sqlite-sync android - add callout
1 parent e0a184b commit 335ba51

File tree

1 file changed

+18
-13
lines changed
  • sqlite-cloud/sqlite-ai/sqlite-sync/quick-starts

1 file changed

+18
-13
lines changed

sqlite-cloud/sqlite-ai/sqlite-sync/quick-starts/android.md renamed to sqlite-cloud/sqlite-ai/sqlite-sync/quick-starts/android.mdx

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ status: publish
66
slug: sqlite-sync-quick-start-android
77
---
88

9-
This guide shows how to integrate sqlite-sync extension into your Android application.
9+
import Callout from "@commons-components/Information/Callout.astro";
10+
11+
This guide shows how to integrate sqlite-sync extension into your Android application.
1012

1113
### 1. Add Dependencies
1214

@@ -30,6 +32,7 @@ dependencies {
3032
// implementation 'com.github.sqliteai:sqlite-sync:0.8.39' // JitPack (alternative)
3133
}
3234
```
35+
3336
</details>
3437

3538
<details>
@@ -50,6 +53,7 @@ dependencies {
5053
// implementation("com.github.sqliteai:sqlite-sync:0.8.39") // JitPack (alternative)
5154
}
5255
```
56+
5357
</details>
5458

5559
### 2. Update AndroidManifest.xml
@@ -66,12 +70,19 @@ Add `android:extractNativeLibs="true"` to your `<application>` tag:
6670

6771
Here’s a complete example showing how to load the extension, create a table, initialize CloudSync, and perform network sync.
6872

69-
> **Important:** Replace the following placeholders with your actual values:
70-
>
71-
> - `database_name` - Your database name
72-
> - `table_name` - Your table name
73-
> - `<connection-string>` - Your SQLiteCloud connection string
74-
> - `<api-key>` - Your SQLiteCloud API key
73+
<Callout type="note">
74+
Replace the following placeholders with your actual values:
75+
- `database_name` - Your database name
76+
- `table_name` - Your table name
77+
- `<connection-string>` - Your SQLiteCloud connection string
78+
- `<api-key>` - Your SQLiteCloud API key
79+
</Callout>
80+
81+
<Callout type="warning">
82+
CloudSync functions must be executed with `SELECT`. In Android, use
83+
`rawQuery()` to call them, and always call `moveToFirst()` (or `moveToNext()`)
84+
on the cursor to ensure the query actually executes.
85+
</Callout>
7586

7687
```kotlin
7788
import android.os.Bundle
@@ -179,9 +190,3 @@ class MainActivity : ComponentActivity() {
179190
}
180191
}
181192
```
182-
183-
### 4. Notes on SQLite Usage in Android
184-
185-
CloudSync functions must be executed with `SELECT`. In Android, use `rawQuery()` to call them, and always call `moveToFirst()` (or `moveToNext()`) on the cursor to ensure the query actually executes.
186-
187-
For detailed SQLite Sync API documentation, see the main [documentation](https://github.com/sqliteai/sqlite-sync/blob/main/README.md).

0 commit comments

Comments
 (0)