Skip to content

Commit 30edd39

Browse files
committed
Add 1.8.x support
1 parent 2f6378f commit 30edd39

34 files changed

+893
-210
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
![Maven Central](https://img.shields.io/maven-central/v/io.appwrite/sdk-for-android.svg?color=green&style=flat-square)
44
![License](https://img.shields.io/github/license/appwrite/sdk-for-android.svg?style=flat-square)
5-
![Version](https://img.shields.io/badge/api%20version-1.7.4-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.8.0-blue.svg?style=flat-square)
66
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
77
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
88
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
99

10-
**This SDK is compatible with Appwrite server version 1.7.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-android/releases).**
10+
**This SDK is compatible with Appwrite server version 1.8.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-android/releases).**
1111

1212
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Android SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
1313

@@ -38,7 +38,7 @@ repositories {
3838
Next, add the dependency to your project's `build.gradle(.kts)` file:
3939

4040
```groovy
41-
implementation("io.appwrite:sdk-for-android:8.2.2")
41+
implementation("io.appwrite:sdk-for-android:9.0.0")
4242
```
4343

4444
### Maven
@@ -49,7 +49,7 @@ Add this to your project's `pom.xml` file:
4949
<dependency>
5050
<groupId>io.appwrite</groupId>
5151
<artifactId>sdk-for-android</artifactId>
52-
<version>8.2.2</version>
52+
<version>9.0.0</version>
5353
</dependency>
5454
</dependencies>
5555
```

docs/examples/java/databases/decrement-document-attribute.md renamed to docs/examples/java/tablesdb/create-row.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
import io.appwrite.Client;
22
import io.appwrite.coroutines.CoroutineCallback;
3-
import io.appwrite.services.Databases;
3+
import io.appwrite.services.TablesDb;
44

55
Client client = new Client(context)
66
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
77
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
88

9-
Databases databases = new Databases(client);
9+
TablesDb tablesDb = new TablesDb(client);
1010

11-
databases.decrementDocumentAttribute(
11+
tablesDb.createRow(
1212
"<DATABASE_ID>", // databaseId
13-
"<COLLECTION_ID>", // collectionId
14-
"<DOCUMENT_ID>", // documentId
15-
"", // attribute
16-
0, // value (optional)
17-
0, // min (optional)
13+
"<TABLE_ID>", // tableId
14+
"<ROW_ID>", // rowId
15+
mapOf( "a" to "b" ), // data
16+
listOf("read("any")"), // permissions (optional)
1817
new CoroutineCallback<>((result, error) -> {
1918
if (error != null) {
2019
error.printStackTrace();

docs/examples/java/databases/increment-document-attribute.md renamed to docs/examples/java/tablesdb/delete-row.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
import io.appwrite.Client;
22
import io.appwrite.coroutines.CoroutineCallback;
3-
import io.appwrite.services.Databases;
3+
import io.appwrite.services.TablesDb;
44

55
Client client = new Client(context)
66
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
77
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
88

9-
Databases databases = new Databases(client);
9+
TablesDb tablesDb = new TablesDb(client);
1010

11-
databases.incrementDocumentAttribute(
11+
tablesDb.deleteRow(
1212
"<DATABASE_ID>", // databaseId
13-
"<COLLECTION_ID>", // collectionId
14-
"<DOCUMENT_ID>", // documentId
15-
"", // attribute
16-
0, // value (optional)
17-
0, // max (optional)
13+
"<TABLE_ID>", // tableId
14+
"<ROW_ID>", // rowId
1815
new CoroutineCallback<>((result, error) -> {
1916
if (error != null) {
2017
error.printStackTrace();
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.TablesDb;
4+
5+
Client client = new Client(context)
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
8+
9+
TablesDb tablesDb = new TablesDb(client);
10+
11+
tablesDb.getRow(
12+
"<DATABASE_ID>", // databaseId
13+
"<TABLE_ID>", // tableId
14+
"<ROW_ID>", // rowId
15+
listOf(), // queries (optional)
16+
new CoroutineCallback<>((result, error) -> {
17+
if (error != null) {
18+
error.printStackTrace();
19+
return;
20+
}
21+
22+
Log.d("Appwrite", result.toString());
23+
})
24+
);
25+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.TablesDb;
4+
5+
Client client = new Client(context)
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
8+
9+
TablesDb tablesDb = new TablesDb(client);
10+
11+
tablesDb.listRows(
12+
"<DATABASE_ID>", // databaseId
13+
"<TABLE_ID>", // tableId
14+
listOf(), // queries (optional)
15+
new CoroutineCallback<>((result, error) -> {
16+
if (error != null) {
17+
error.printStackTrace();
18+
return;
19+
}
20+
21+
Log.d("Appwrite", result.toString());
22+
})
23+
);
24+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.TablesDb;
4+
5+
Client client = new Client(context)
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
8+
9+
TablesDb tablesDb = new TablesDb(client);
10+
11+
tablesDb.updateRow(
12+
"<DATABASE_ID>", // databaseId
13+
"<TABLE_ID>", // tableId
14+
"<ROW_ID>", // rowId
15+
mapOf( "a" to "b" ), // data (optional)
16+
listOf("read("any")"), // permissions (optional)
17+
new CoroutineCallback<>((result, error) -> {
18+
if (error != null) {
19+
error.printStackTrace();
20+
return;
21+
}
22+
23+
Log.d("Appwrite", result.toString());
24+
})
25+
);
26+
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.TablesDb;
4+
5+
Client client = new Client(context)
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
8+
9+
TablesDb tablesDb = new TablesDb(client);
10+
11+
tablesDb.upsertRow(
12+
"<DATABASE_ID>", // databaseId
13+
"<TABLE_ID>", // tableId
14+
"<ROW_ID>", // rowId
15+
mapOf( "a" to "b" ), // data (optional)
16+
listOf("read("any")"), // permissions (optional)
17+
new CoroutineCallback<>((result, error) -> {
18+
if (error != null) {
19+
error.printStackTrace();
20+
return;
21+
}
22+
23+
Log.d("Appwrite", result.toString());
24+
})
25+
);
26+
Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
import io.appwrite.Client
22
import io.appwrite.coroutines.CoroutineCallback
3-
import io.appwrite.services.Databases
3+
import io.appwrite.services.TablesDb
44

55
val client = Client(context)
66
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
77
.setProject("<YOUR_PROJECT_ID>") // Your project ID
88

9-
val databases = Databases(client)
9+
val tablesDb = TablesDb(client)
1010

11-
val result = databases.decrementDocumentAttribute(
11+
val result = tablesDb.createRow(
1212
databaseId = "<DATABASE_ID>",
13-
collectionId = "<COLLECTION_ID>",
14-
documentId = "<DOCUMENT_ID>",
15-
attribute = "",
16-
value = 0, // (optional)
17-
min = 0, // (optional)
13+
tableId = "<TABLE_ID>",
14+
rowId = "<ROW_ID>",
15+
data = mapOf( "a" to "b" ),
16+
permissions = listOf("read("any")"), // (optional)
1817
)
Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
import io.appwrite.Client
22
import io.appwrite.coroutines.CoroutineCallback
3-
import io.appwrite.services.Databases
3+
import io.appwrite.services.TablesDb
44

55
val client = Client(context)
66
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
77
.setProject("<YOUR_PROJECT_ID>") // Your project ID
88

9-
val databases = Databases(client)
9+
val tablesDb = TablesDb(client)
1010

11-
val result = databases.incrementDocumentAttribute(
11+
val result = tablesDb.deleteRow(
1212
databaseId = "<DATABASE_ID>",
13-
collectionId = "<COLLECTION_ID>",
14-
documentId = "<DOCUMENT_ID>",
15-
attribute = "",
16-
value = 0, // (optional)
17-
max = 0, // (optional)
13+
tableId = "<TABLE_ID>",
14+
rowId = "<ROW_ID>",
1815
)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import io.appwrite.Client
2+
import io.appwrite.coroutines.CoroutineCallback
3+
import io.appwrite.services.TablesDb
4+
5+
val client = Client(context)
6+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
7+
.setProject("<YOUR_PROJECT_ID>") // Your project ID
8+
9+
val tablesDb = TablesDb(client)
10+
11+
val result = tablesDb.getRow(
12+
databaseId = "<DATABASE_ID>",
13+
tableId = "<TABLE_ID>",
14+
rowId = "<ROW_ID>",
15+
queries = listOf(), // (optional)
16+
)

0 commit comments

Comments
 (0)