Skip to content

Commit 3f72f75

Browse files
feat: introduce 0.15.x support
1 parent ce50b94 commit 3f72f75

Some content is hidden

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

42 files changed

+910
-153
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-0.14.0-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-0.15.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 0.14.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.15.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:0.6.1")
41+
implementation("io.appwrite:sdk-for-android:0.7.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>0.6.1</version>
52+
<version>0.7.0</version>
5353
</dependency>
5454
</dependencies>
5555
```

docs/examples/java/account/create-session.md renamed to docs/examples/java/account/create-email-session.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class MainActivity extends AppCompatActivity {
1818

1919
Account account = new Account(client);
2020

21-
account.createSession(
21+
account.createEmailSession(
2222
2323
"password"
2424
new Continuation<Object>() {
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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.createPhoneSession(
22+
"[USER_ID]",
23+
""
24+
new Continuation<Object>() {
25+
@NotNull
26+
@Override
27+
public CoroutineContext getContext() {
28+
return EmptyCoroutineContext.INSTANCE;
29+
}
30+
31+
@Override
32+
public void resumeWith(@NotNull Object o) {
33+
String json = "";
34+
try {
35+
if (o instanceof Result.Failure) {
36+
Result.Failure failure = (Result.Failure) o;
37+
throw failure.exception;
38+
} else {
39+
Response response = (Response) o;
40+
json = response.body().string();
41+
}
42+
} catch (Throwable th) {
43+
Log.e("ERROR", th.toString());
44+
}
45+
}
46+
}
47+
);
48+
}
49+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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.createPhoneVerification(new Continuation<Object>() {
22+
@NotNull
23+
@Override
24+
public CoroutineContext getContext() {
25+
return EmptyCoroutineContext.INSTANCE;
26+
}
27+
28+
@Override
29+
public void resumeWith(@NotNull Object o) {
30+
String json = "";
31+
try {
32+
if (o instanceof Result.Failure) {
33+
Result.Failure failure = (Result.Failure) o;
34+
throw failure.exception;
35+
} else {
36+
Response response = (Response) o;
37+
json = response.body().string();
38+
}
39+
}
40+
} catch (Throwable th) {
41+
Log.e("ERROR", th.toString());
42+
}
43+
}
44+
});
45+
}
46+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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.updatePhoneSession(
22+
"[USER_ID]",
23+
"[SECRET]"
24+
new Continuation<Object>() {
25+
@NotNull
26+
@Override
27+
public CoroutineContext getContext() {
28+
return EmptyCoroutineContext.INSTANCE;
29+
}
30+
31+
@Override
32+
public void resumeWith(@NotNull Object o) {
33+
String json = "";
34+
try {
35+
if (o instanceof Result.Failure) {
36+
Result.Failure failure = (Result.Failure) o;
37+
throw failure.exception;
38+
} else {
39+
Response response = (Response) o;
40+
json = response.body().string();
41+
}
42+
} catch (Throwable th) {
43+
Log.e("ERROR", th.toString());
44+
}
45+
}
46+
}
47+
);
48+
}
49+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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.updatePhoneVerification(
22+
"[USER_ID]",
23+
"[SECRET]"
24+
new Continuation<Object>() {
25+
@NotNull
26+
@Override
27+
public CoroutineContext getContext() {
28+
return EmptyCoroutineContext.INSTANCE;
29+
}
30+
31+
@Override
32+
public void resumeWith(@NotNull Object o) {
33+
String json = "";
34+
try {
35+
if (o instanceof Result.Failure) {
36+
Result.Failure failure = (Result.Failure) o;
37+
throw failure.exception;
38+
} else {
39+
Response response = (Response) o;
40+
json = response.body().string();
41+
}
42+
} catch (Throwable th) {
43+
Log.e("ERROR", th.toString());
44+
}
45+
}
46+
}
47+
);
48+
}
49+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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.updatePhone(
22+
"",
23+
"password"
24+
new Continuation<Object>() {
25+
@NotNull
26+
@Override
27+
public CoroutineContext getContext() {
28+
return EmptyCoroutineContext.INSTANCE;
29+
}
30+
31+
@Override
32+
public void resumeWith(@NotNull Object o) {
33+
String json = "";
34+
try {
35+
if (o instanceof Result.Failure) {
36+
Result.Failure failure = (Result.Failure) o;
37+
throw failure.exception;
38+
} else {
39+
Response response = (Response) o;
40+
json = response.body().string();
41+
}
42+
} catch (Throwable th) {
43+
Log.e("ERROR", th.toString());
44+
}
45+
}
46+
}
47+
);
48+
}
49+
}

docs/examples/java/database/create-document.md renamed to docs/examples/java/databases/create-document.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import android.os.Bundle
33
import kotlinx.coroutines.GlobalScope
44
import kotlinx.coroutines.launch
55
import io.appwrite.Client
6-
import io.appwrite.services.Database
6+
import io.appwrite.services.Databases
77

88
public class MainActivity extends AppCompatActivity {
99

@@ -16,9 +16,9 @@ public class MainActivity extends AppCompatActivity {
1616
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
1717
.setProject("5df5acd0d48c2"); // Your project ID
1818

19-
Database database = new Database(client);
19+
Databases databases = new Databases(client, "[DATABASE_ID]");
2020

21-
database.createDocument(
21+
databases.createDocument(
2222
"[COLLECTION_ID]",
2323
"[DOCUMENT_ID]",
2424
mapOf( "a" to "b" ),

docs/examples/java/database/delete-document.md renamed to docs/examples/java/databases/delete-document.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import android.os.Bundle
33
import kotlinx.coroutines.GlobalScope
44
import kotlinx.coroutines.launch
55
import io.appwrite.Client
6-
import io.appwrite.services.Database
6+
import io.appwrite.services.Databases
77

88
public class MainActivity extends AppCompatActivity {
99

@@ -16,9 +16,9 @@ public class MainActivity extends AppCompatActivity {
1616
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
1717
.setProject("5df5acd0d48c2"); // Your project ID
1818

19-
Database database = new Database(client);
19+
Databases databases = new Databases(client, "[DATABASE_ID]");
2020

21-
database.deleteDocument(
21+
databases.deleteDocument(
2222
"[COLLECTION_ID]",
2323
"[DOCUMENT_ID]"
2424
new Continuation<Object>() {

docs/examples/java/database/get-document.md renamed to docs/examples/java/databases/get-document.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import android.os.Bundle
33
import kotlinx.coroutines.GlobalScope
44
import kotlinx.coroutines.launch
55
import io.appwrite.Client
6-
import io.appwrite.services.Database
6+
import io.appwrite.services.Databases
77

88
public class MainActivity extends AppCompatActivity {
99

@@ -16,9 +16,9 @@ public class MainActivity extends AppCompatActivity {
1616
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
1717
.setProject("5df5acd0d48c2"); // Your project ID
1818

19-
Database database = new Database(client);
19+
Databases databases = new Databases(client, "[DATABASE_ID]");
2020

21-
database.getDocument(
21+
databases.getDocument(
2222
"[COLLECTION_ID]",
2323
"[DOCUMENT_ID]"
2424
new Continuation<Object>() {

docs/examples/java/database/list-documents.md renamed to docs/examples/java/databases/list-documents.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import android.os.Bundle
33
import kotlinx.coroutines.GlobalScope
44
import kotlinx.coroutines.launch
55
import io.appwrite.Client
6-
import io.appwrite.services.Database
6+
import io.appwrite.services.Databases
77

88
public class MainActivity extends AppCompatActivity {
99

@@ -16,9 +16,9 @@ public class MainActivity extends AppCompatActivity {
1616
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
1717
.setProject("5df5acd0d48c2"); // Your project ID
1818

19-
Database database = new Database(client);
19+
Databases databases = new Databases(client, "[DATABASE_ID]");
2020

21-
database.listDocuments(
21+
databases.listDocuments(
2222
"[COLLECTION_ID]",
2323
new Continuation<Object>() {
2424
@NotNull

0 commit comments

Comments
 (0)