From 75d3c39763aacc3eec8572a5e80cb69e2d2f203d Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Tue, 1 Jun 2021 16:02:50 +0545 Subject: [PATCH] android changelog and getting started --- docs/sdks/android/CHANGELOG.md | 1 + docs/sdks/android/GETTING_STARTED.md | 55 ++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 docs/sdks/android/CHANGELOG.md create mode 100644 docs/sdks/android/GETTING_STARTED.md diff --git a/docs/sdks/android/CHANGELOG.md b/docs/sdks/android/CHANGELOG.md new file mode 100644 index 000000000..fa4d35e68 --- /dev/null +++ b/docs/sdks/android/CHANGELOG.md @@ -0,0 +1 @@ +# Change Log \ No newline at end of file diff --git a/docs/sdks/android/GETTING_STARTED.md b/docs/sdks/android/GETTING_STARTED.md new file mode 100644 index 000000000..6bd618505 --- /dev/null +++ b/docs/sdks/android/GETTING_STARTED.md @@ -0,0 +1,55 @@ +## Getting Started + +### Init your SDK + +

Initialize your SDK code with your project ID, which can be found in your project settings page. + +```kotlin +import io.appwrite.AppwriteClient +import io.appwrite.services.AccountService + +val client = AppwriteClient(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setSelfSigned(true) // Remove in production +``` + +Before starting to send any API calls to your new Appwrite instance, make sure your Android emulators has network access to the Appwrite server hostname or IP address. + +When trying to connect to Appwrite from an emulator or a mobile device, localhost is the hostname for the device or emulator and not your local Appwrite instance. You should replace localhost with your private IP as the Appwrite endpoint's hostname. You can also use a service like [ngrok](https://ngrok.com/) to proxy the Appwrite API. + +### Make Your First Request + +

Once your SDK object is set, access any of the Appwrite services and choose any request to send. Full documentation for any service method you would like to use can be found in your SDK documentation or in the API References section. + +```kotlin +// Register User +val accountService = AccountService(client) +val user = accountService.create( + "email@example.com", + "password" +) +``` + +### Full Example + +```kotlin +import io.appwrite.AppwriteClient +import io.appwrite.services.AccountService + +val client = AppwriteClient(context) + .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint + .setProject("5df5acd0d48c2") // Your project ID + .setSelfSigned(true) // Remove in production + +val accountService = AccountService(client) +val user = accountService.create( + "email@example.com", + "password" +) +``` + +### Learn more +You can use followng resources to learn more and get help +- 📜 [Appwrite Docs](https://appwrite.io/docs) +- 💬 [Discord Community](https://appwrite.io/discord) \ No newline at end of file