-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
612 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
} | ||
} | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
} | ||
} | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.