Skip to content

Commit c7827ae

Browse files
committed
0.13 support snapshot
1 parent 63f3795 commit c7827ae

37 files changed

+612
-216
lines changed

README.md

Lines changed: 3 additions & 3 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-0.12.1-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-0.12.3-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 0.12.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 0.13.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

@@ -158,4 +158,4 @@ This library is auto-generated by Appwrite custom [SDK Generator](https://github
158158

159159
## License
160160

161-
Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.
161+
Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apply plugin: 'io.github.gradle-nexus.publish-plugin'
33
// Top-level build file where you can add configuration options common to all sub-projects/modules.
44
buildscript {
55
ext.kotlin_version = "1.5.31"
6-
version "0.3.3"
6+
version System.getenv("SDK_VERSION")
77
repositories {
88
maven { url "https://plugins.gradle.org/m2/" }
99
google()
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import androidx.appcompat.app.AppCompatActivity
2+
import android.os.Bundle
3+
import kotlinx.coroutines.GlobalScope
4+
import kotlinx.coroutines.launch
5+
import io.appwrite.Client
6+
import io.appwrite.services.Account
7+
8+
public class MainActivity extends AppCompatActivity {
9+
10+
@Override
11+
protected void onCreate(Bundle savedInstanceState) {
12+
super.onCreate(savedInstanceState);
13+
setContentView(R.layout.activity_main);
14+
15+
Client client = new Client(getApplicationContext())
16+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
17+
.setProject("5df5acd0d48c2"); // Your project ID
18+
19+
Account account = new Account(client);
20+
21+
account.updateSession(
22+
"[SESSION_ID]"
23+
new Continuation<Object>() {
24+
@NotNull
25+
@Override
26+
public CoroutineContext getContext() {
27+
return EmptyCoroutineContext.INSTANCE;
28+
}
29+
30+
@Override
31+
public void resumeWith(@NotNull Object o) {
32+
String json = "";
33+
try {
34+
if (o instanceof Result.Failure) {
35+
Result.Failure failure = (Result.Failure) o;
36+
throw failure.exception;
37+
} else {
38+
Response response = (Response) o;
39+
json = response.body().string();
40+
}
41+
} catch (Throwable th) {
42+
Log.e("ERROR", th.toString());
43+
}
44+
}
45+
}
46+
);
47+
}
48+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import androidx.appcompat.app.AppCompatActivity
2+
import android.os.Bundle
3+
import kotlinx.coroutines.GlobalScope
4+
import kotlinx.coroutines.launch
5+
import io.appwrite.Client
6+
import io.appwrite.services.Functions
7+
8+
public class MainActivity extends AppCompatActivity {
9+
10+
@Override
11+
protected void onCreate(Bundle savedInstanceState) {
12+
super.onCreate(savedInstanceState);
13+
setContentView(R.layout.activity_main);
14+
15+
Client client = new Client(getApplicationContext())
16+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
17+
.setProject("5df5acd0d48c2"); // Your project ID
18+
19+
Functions functions = new Functions(client);
20+
21+
functions.retryBuild(
22+
"[FUNCTION_ID]",
23+
"[DEPLOYMENT_ID]",
24+
"[BUILD_ID]"
25+
new Continuation<Object>() {
26+
@NotNull
27+
@Override
28+
public CoroutineContext getContext() {
29+
return EmptyCoroutineContext.INSTANCE;
30+
}
31+
32+
@Override
33+
public void resumeWith(@NotNull Object o) {
34+
String json = "";
35+
try {
36+
if (o instanceof Result.Failure) {
37+
Result.Failure failure = (Result.Failure) o;
38+
throw failure.exception;
39+
} else {
40+
Response response = (Response) o;
41+
json = response.body().string();
42+
}
43+
} catch (Throwable th) {
44+
Log.e("ERROR", th.toString());
45+
}
46+
}
47+
}
48+
);
49+
}
50+
}

docs/examples/java/storage/create-file.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class MainActivity extends AppCompatActivity {
1919
Storage storage = new Storage(client);
2020

2121
storage.createFile(
22+
"[BUCKET_ID]",
2223
"[FILE_ID]",
2324
File("./path-to-files/image.jpg"),
2425
new Continuation<Object>() {

docs/examples/java/storage/delete-file.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class MainActivity extends AppCompatActivity {
1919
Storage storage = new Storage(client);
2020

2121
storage.deleteFile(
22+
"[BUCKET_ID]",
2223
"[FILE_ID]"
2324
new Continuation<Object>() {
2425
@NotNull

docs/examples/java/storage/get-file-download.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class MainActivity extends AppCompatActivity {
1919
Storage storage = new Storage(client);
2020

2121
storage.getFileDownload(
22+
"[BUCKET_ID]",
2223
"[FILE_ID]"
2324
new Continuation<Object>() {
2425
@NotNull

docs/examples/java/storage/get-file-preview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class MainActivity extends AppCompatActivity {
1919
Storage storage = new Storage(client);
2020

2121
storage.getFilePreview(
22+
"[BUCKET_ID]",
2223
"[FILE_ID]",
2324
new Continuation<Object>() {
2425
@NotNull

docs/examples/java/storage/get-file-view.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class MainActivity extends AppCompatActivity {
1919
Storage storage = new Storage(client);
2020

2121
storage.getFileView(
22+
"[BUCKET_ID]",
2223
"[FILE_ID]"
2324
new Continuation<Object>() {
2425
@NotNull

docs/examples/java/storage/get-file.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class MainActivity extends AppCompatActivity {
1919
Storage storage = new Storage(client);
2020

2121
storage.getFile(
22+
"[BUCKET_ID]",
2223
"[FILE_ID]"
2324
new Continuation<Object>() {
2425
@NotNull

0 commit comments

Comments
 (0)