Skip to content

Commit 8e8d95c

Browse files
authored
Merge pull request #98 from appwrite/dev
feat: Android SDK update for version 11.4.0
2 parents ec4ba5b + 906ecd3 commit 8e8d95c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1162
-108
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Change Log
22

3+
## 11.4.0
4+
5+
* Add `getScreenshot` method to `Avatars` service
6+
* Add `Theme`, `Timezone` and `Output` enums
7+
38
## 11.3.0
49

510
* Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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:11.3.0")
41+
implementation("io.appwrite:sdk-for-android:11.4.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>11.3.0</version>
52+
<version>11.4.0</version>
5353
</dependency>
5454
</dependencies>
5555
```

docs/examples/java/account/create-o-auth-2-session.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ account.createOAuth2Session(
1313
OAuthProvider.AMAZON, // provider
1414
"https://example.com", // success (optional)
1515
"https://example.com", // failure (optional)
16-
listOf(), // scopes (optional)
16+
List.of(), // scopes (optional)
1717
new CoroutineCallback<>((result, error) -> {
1818
if (error != null) {
1919
error.printStackTrace();

docs/examples/java/account/create-o-auth-2-token.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ account.createOAuth2Token(
1313
OAuthProvider.AMAZON, // provider
1414
"https://example.com", // success (optional)
1515
"https://example.com", // failure (optional)
16-
listOf(), // scopes (optional)
16+
List.of(), // scopes (optional)
1717
new CoroutineCallback<>((result, error) -> {
1818
if (error != null) {
1919
error.printStackTrace();

docs/examples/java/account/list-identities.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Client client = new Client(context)
99
Account account = new Account(client);
1010

1111
account.listIdentities(
12-
listOf(), // queries (optional)
12+
List.of(), // queries (optional)
1313
false, // total (optional)
1414
new CoroutineCallback<>((result, error) -> {
1515
if (error != null) {

docs/examples/java/account/list-logs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Client client = new Client(context)
99
Account account = new Account(client);
1010

1111
account.listLogs(
12-
listOf(), // queries (optional)
12+
List.of(), // queries (optional)
1313
false, // total (optional)
1414
new CoroutineCallback<>((result, error) -> {
1515
if (error != null) {

docs/examples/java/account/update-prefs.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ Client client = new Client(context)
99
Account account = new Account(client);
1010

1111
account.updatePrefs(
12-
mapOf(
13-
"language" to "en",
14-
"timezone" to "UTC",
15-
"darkTheme" to true
12+
Map.of(
13+
"language", "en",
14+
"timezone", "UTC",
15+
"darkTheme", true
1616
), // prefs
1717
new CoroutineCallback<>((result, error) -> {
1818
if (error != null) {
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Avatars;
4+
import io.appwrite.enums.Theme;
5+
import io.appwrite.enums.Timezone;
6+
import io.appwrite.enums.Output;
7+
8+
Client client = new Client(context)
9+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
10+
.setProject("<YOUR_PROJECT_ID>"); // Your project ID
11+
12+
Avatars avatars = new Avatars(client);
13+
14+
avatars.getScreenshot(
15+
"https://example.com", // url
16+
Map.of(
17+
"Authorization", "Bearer token123",
18+
"X-Custom-Header", "value"
19+
), // headers (optional)
20+
1920, // viewportWidth (optional)
21+
1080, // viewportHeight (optional)
22+
2, // scale (optional)
23+
Theme.LIGHT, // theme (optional)
24+
"Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15", // userAgent (optional)
25+
true, // fullpage (optional)
26+
"en-US", // locale (optional)
27+
Timezone.AFRICA_ABIDJAN, // timezone (optional)
28+
37.7749, // latitude (optional)
29+
-122.4194, // longitude (optional)
30+
100, // accuracy (optional)
31+
true, // touch (optional)
32+
List.of("geolocation", "notifications"), // permissions (optional)
33+
3, // sleep (optional)
34+
800, // width (optional)
35+
600, // height (optional)
36+
85, // quality (optional)
37+
Output.JPG, // output (optional)
38+
new CoroutineCallback<>((result, error) -> {
39+
if (error != null) {
40+
error.printStackTrace();
41+
return;
42+
}
43+
44+
Log.d("Appwrite", result.toString());
45+
})
46+
);
47+

docs/examples/java/databases/create-document.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import io.appwrite.Client;
22
import io.appwrite.coroutines.CoroutineCallback;
3-
import io.appwrite.services.Databases;
43
import io.appwrite.Permission;
54
import io.appwrite.Role;
5+
import io.appwrite.services.Databases;
66

77
Client client = new Client(context)
88
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
@@ -14,14 +14,14 @@ databases.createDocument(
1414
"<DATABASE_ID>", // databaseId
1515
"<COLLECTION_ID>", // collectionId
1616
"<DOCUMENT_ID>", // documentId
17-
mapOf(
18-
"username" to "walter.obrien",
19-
"email" to "walter.obrien@example.com",
20-
"fullName" to "Walter O'Brien",
21-
"age" to 30,
22-
"isAdmin" to false
17+
Map.of(
18+
"username", "walter.obrien",
19+
"email", "walter.obrien@example.com",
20+
"fullName", "Walter O'Brien",
21+
"age", 30,
22+
"isAdmin", false
2323
), // data
24-
listOf(Permission.read(Role.any())), // permissions (optional)
24+
List.of(Permission.read(Role.any())), // permissions (optional)
2525
"<TRANSACTION_ID>", // transactionId (optional)
2626
new CoroutineCallback<>((result, error) -> {
2727
if (error != null) {

docs/examples/java/databases/create-operations.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,15 @@ Databases databases = new Databases(client);
1010

1111
databases.createOperations(
1212
"<TRANSACTION_ID>", // transactionId
13-
listOf(
14-
{
15-
"action": "create",
16-
"databaseId": "<DATABASE_ID>",
17-
"collectionId": "<COLLECTION_ID>",
18-
"documentId": "<DOCUMENT_ID>",
19-
"data": {
20-
"name": "Walter O'Brien"
21-
}
22-
}
23-
), // operations (optional)
13+
List.of(Map.of(
14+
"action", "create",
15+
"databaseId", "<DATABASE_ID>",
16+
"collectionId", "<COLLECTION_ID>",
17+
"documentId", "<DOCUMENT_ID>",
18+
"data", Map.of(
19+
"name", "Walter O'Brien"
20+
)
21+
)), // operations (optional)
2422
new CoroutineCallback<>((result, error) -> {
2523
if (error != null) {
2624
error.printStackTrace();

0 commit comments

Comments
 (0)