Appwrite companion cookbook
Initialize your SDK code with your project ID, which can be found in your project settings page.
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 to proxy the Appwrite API.
import io.appwrite.Client import io.appwrite.services.Account val client = Client(context) .setEndpoint("apiendpoint") // Your API Endpoint .setProject("Project_ID") // Your project ID .setSelfSigned(status: true) // For self signed certificates, only use for development