Skip to content

Commit 37a3256

Browse files
committed
Update for 1.0.0
1 parent 64ef040 commit 37a3256

27 files changed

+706
-51
lines changed

README.md

Lines changed: 11 additions & 10 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.0.0-RC1-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.0.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.0.0-RC1. 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.0.0. 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:1.0.0-SNAPSHOT")
41+
implementation("io.appwrite:sdk-for-android:1.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>1.0.0-SNAPSHOT</version>
52+
<version>1.0.0</version>
5353
</dependency>
5454
</dependencies>
5555
```
@@ -108,7 +108,7 @@ When trying to connect to Appwrite from an emulator or a mobile device, localhos
108108
// Register User
109109
val account = Account(client)
110110
val response = account.create(
111-
"[USER_ID]",
111+
ID.unique(),
112112
113113
"password"
114114
)
@@ -119,15 +119,16 @@ val response = account.create(
119119
```kotlin
120120
import io.appwrite.Client
121121
import io.appwrite.services.Account
122+
import io.appwrite.ID
122123

123124
val client = Client(context)
124125
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
125126
.setProject("5df5acd0d48c2") // Your project ID
126127
.setSelfSigned(true) // Remove in production
127128

128129
val account = Account(client)
129-
val response = account.create(
130-
"[USER_ID]",
130+
val user = account.create(
131+
ID.unique(),
131132
132133
"password"
133134
)
@@ -138,10 +139,10 @@ The Appwrite Android SDK raises an `AppwriteException` object with `message`, `c
138139

139140
```kotlin
140141
try {
141-
var response = account.create("[USER_ID]", "[email protected]", "password")
142-
Log.d("Appwrite response", response.body?.string())
142+
var user = account.create(ID.unique(), "[email protected]", "password")
143+
Log.d("Appwrite user", user.toMap())
143144
} catch(e : AppwriteException) {
144-
Log.e("AppwriteException",e.message.toString())
145+
e.printStackTrace()
145146
}
146147
```
147148

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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.listLogs(
22+
new Continuation<Object>() {
23+
@NotNull
24+
@Override
25+
public CoroutineContext getContext() {
26+
return EmptyCoroutineContext.INSTANCE;
27+
}
28+
29+
@Override
30+
public void resumeWith(@NotNull Object o) {
31+
String json = "";
32+
try {
33+
if (o instanceof Result.Failure) {
34+
Result.Failure failure = (Result.Failure) o;
35+
throw failure.exception;
36+
} else {
37+
Response response = (Response) o;
38+
json = response.body().string();
39+
}
40+
} catch (Throwable th) {
41+
Log.e("ERROR", th.toString());
42+
}
43+
}
44+
}
45+
);
46+
}
47+
}
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.listSessions(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: 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.Locale
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+
Locale locale = new Locale(client);
20+
21+
locale.listContinents(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: 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.Locale
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+
Locale locale = new Locale(client);
20+
21+
locale.listCountriesEU(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: 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.Locale
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+
Locale locale = new Locale(client);
20+
21+
locale.listCountriesPhones(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: 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.Locale
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+
Locale locale = new Locale(client);
20+
21+
locale.listCountries(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+
}

0 commit comments

Comments
 (0)