Skip to content

Commit

Permalink
0.13 support snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
abnegate committed Mar 1, 2022
1 parent 63f3795 commit c7827ae
Show file tree
Hide file tree
Showing 37 changed files with 612 additions and 216 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

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

**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).**
**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).**

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)

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

## License

Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.
Please see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply plugin: 'io.github.gradle-nexus.publish-plugin'
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.5.31"
version "0.3.3"
version System.getenv("SDK_VERSION")
repositories {
maven { url "https://plugins.gradle.org/m2/" }
google()
Expand Down
48 changes: 48 additions & 0 deletions docs/examples/java/account/update-session.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import io.appwrite.Client
import io.appwrite.services.Account

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Client client = new Client(getApplicationContext())
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID

Account account = new Account(client);

account.updateSession(
"[SESSION_ID]"
new Continuation<Object>() {
@NotNull
@Override
public CoroutineContext getContext() {
return EmptyCoroutineContext.INSTANCE;
}

@Override
public void resumeWith(@NotNull Object o) {
String json = "";
try {
if (o instanceof Result.Failure) {
Result.Failure failure = (Result.Failure) o;
throw failure.exception;
} else {
Response response = (Response) o;
json = response.body().string();
}
} catch (Throwable th) {
Log.e("ERROR", th.toString());
}
}
}
);
}
}
50 changes: 50 additions & 0 deletions docs/examples/java/functions/retry-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import io.appwrite.Client
import io.appwrite.services.Functions

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Client client = new Client(getApplicationContext())
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID

Functions functions = new Functions(client);

functions.retryBuild(
"[FUNCTION_ID]",
"[DEPLOYMENT_ID]",
"[BUILD_ID]"
new Continuation<Object>() {
@NotNull
@Override
public CoroutineContext getContext() {
return EmptyCoroutineContext.INSTANCE;
}

@Override
public void resumeWith(@NotNull Object o) {
String json = "";
try {
if (o instanceof Result.Failure) {
Result.Failure failure = (Result.Failure) o;
throw failure.exception;
} else {
Response response = (Response) o;
json = response.body().string();
}
} catch (Throwable th) {
Log.e("ERROR", th.toString());
}
}
}
);
}
}
1 change: 1 addition & 0 deletions docs/examples/java/storage/create-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class MainActivity extends AppCompatActivity {
Storage storage = new Storage(client);

storage.createFile(
"[BUCKET_ID]",
"[FILE_ID]",
File("./path-to-files/image.jpg"),
new Continuation<Object>() {
Expand Down
1 change: 1 addition & 0 deletions docs/examples/java/storage/delete-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class MainActivity extends AppCompatActivity {
Storage storage = new Storage(client);

storage.deleteFile(
"[BUCKET_ID]",
"[FILE_ID]"
new Continuation<Object>() {
@NotNull
Expand Down
1 change: 1 addition & 0 deletions docs/examples/java/storage/get-file-download.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class MainActivity extends AppCompatActivity {
Storage storage = new Storage(client);

storage.getFileDownload(
"[BUCKET_ID]",
"[FILE_ID]"
new Continuation<Object>() {
@NotNull
Expand Down
1 change: 1 addition & 0 deletions docs/examples/java/storage/get-file-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class MainActivity extends AppCompatActivity {
Storage storage = new Storage(client);

storage.getFilePreview(
"[BUCKET_ID]",
"[FILE_ID]",
new Continuation<Object>() {
@NotNull
Expand Down
1 change: 1 addition & 0 deletions docs/examples/java/storage/get-file-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class MainActivity extends AppCompatActivity {
Storage storage = new Storage(client);

storage.getFileView(
"[BUCKET_ID]",
"[FILE_ID]"
new Continuation<Object>() {
@NotNull
Expand Down
1 change: 1 addition & 0 deletions docs/examples/java/storage/get-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class MainActivity extends AppCompatActivity {
Storage storage = new Storage(client);

storage.getFile(
"[BUCKET_ID]",
"[FILE_ID]"
new Continuation<Object>() {
@NotNull
Expand Down
1 change: 1 addition & 0 deletions docs/examples/java/storage/list-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class MainActivity extends AppCompatActivity {
Storage storage = new Storage(client);

storage.listFiles(
"[BUCKET_ID]",
new Continuation<Object>() {
@NotNull
@Override
Expand Down
3 changes: 1 addition & 2 deletions docs/examples/java/storage/update-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ public class MainActivity extends AppCompatActivity {
Storage storage = new Storage(client);

storage.updateFile(
"[BUCKET_ID]",
"[FILE_ID]",
listOf(),
listOf()
new Continuation<Object>() {
@NotNull
@Override
Expand Down
26 changes: 26 additions & 0 deletions docs/examples/kotlin/account/update-session.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import io.appwrite.Client
import io.appwrite.services.Account

class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

val client = Client(applicationContext)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID

val account = Account(client)

GlobalScope.launch {
val response = account.updateSession(
sessionId = "[SESSION_ID]"
)
val json = response.body?.string()
}
}
}
28 changes: 28 additions & 0 deletions docs/examples/kotlin/functions/retry-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import io.appwrite.Client
import io.appwrite.services.Functions

class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

val client = Client(applicationContext)
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID

val functions = Functions(client)

GlobalScope.launch {
val response = functions.retryBuild(
functionId = "[FUNCTION_ID]",
deploymentId = "[DEPLOYMENT_ID]",
buildId = "[BUILD_ID]"
)
val json = response.body?.string()
}
}
}
1 change: 1 addition & 0 deletions docs/examples/kotlin/storage/create-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class MainActivity : AppCompatActivity() {

GlobalScope.launch {
val response = storage.createFile(
bucketId = "[BUCKET_ID]",
fileId = "[FILE_ID]",
file = File("./path-to-files/image.jpg"),
)
Expand Down
1 change: 1 addition & 0 deletions docs/examples/kotlin/storage/delete-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class MainActivity : AppCompatActivity() {

GlobalScope.launch {
val response = storage.deleteFile(
bucketId = "[BUCKET_ID]",
fileId = "[FILE_ID]"
)
val json = response.body?.string()
Expand Down
1 change: 1 addition & 0 deletions docs/examples/kotlin/storage/get-file-download.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class MainActivity : AppCompatActivity() {

GlobalScope.launch {
val result = storage.getFileDownload(
bucketId = "[BUCKET_ID]",
fileId = "[FILE_ID]"
)
println(result); // Resource URL
Expand Down
1 change: 1 addition & 0 deletions docs/examples/kotlin/storage/get-file-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class MainActivity : AppCompatActivity() {

GlobalScope.launch {
val result = storage.getFilePreview(
bucketId = "[BUCKET_ID]",
fileId = "[FILE_ID]",
)
println(result); // Resource URL
Expand Down
1 change: 1 addition & 0 deletions docs/examples/kotlin/storage/get-file-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class MainActivity : AppCompatActivity() {

GlobalScope.launch {
val result = storage.getFileView(
bucketId = "[BUCKET_ID]",
fileId = "[FILE_ID]"
)
println(result); // Resource URL
Expand Down
1 change: 1 addition & 0 deletions docs/examples/kotlin/storage/get-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class MainActivity : AppCompatActivity() {

GlobalScope.launch {
val response = storage.getFile(
bucketId = "[BUCKET_ID]",
fileId = "[FILE_ID]"
)
val json = response.body?.string()
Expand Down
1 change: 1 addition & 0 deletions docs/examples/kotlin/storage/list-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class MainActivity : AppCompatActivity() {

GlobalScope.launch {
val response = storage.listFiles(
bucketId = "[BUCKET_ID]",
)
val json = response.body?.string()
}
Expand Down
3 changes: 1 addition & 2 deletions docs/examples/kotlin/storage/update-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ class MainActivity : AppCompatActivity() {

GlobalScope.launch {
val response = storage.updateFile(
bucketId = "[BUCKET_ID]",
fileId = "[FILE_ID]",
read = listOf(),
write = listOf()
)
val json = response.body?.string()
}
Expand Down
Empty file modified gradlew
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ ext {
GITHUB_SCM_CONNECTION = 'scm:git:git://github.com/appwrite/sdk-for-android.git'
}

version PUBLISH_VERSION

android {
compileSdkVersion(31)

Expand Down
Loading

0 comments on commit c7827ae

Please sign in to comment.