{"id":13534123,"url":"https://github.com/appwrite/sdk-for-android","last_synced_at":"2026-02-13T15:18:37.962Z","repository":{"id":39918713,"uuid":"374978100","full_name":"appwrite/sdk-for-android","owner":"appwrite","description":"[READ-ONLY] Official Appwrite Android SDK 💚  🤖","archived":false,"fork":false,"pushed_at":"2026-02-02T12:58:20.000Z","size":789,"stargazers_count":150,"open_issues_count":15,"forks_count":27,"subscribers_count":11,"default_branch":"main","last_synced_at":"2026-02-10T19:28:33.507Z","etag":null,"topics":["android","android-library","appwrite","baas","firebase","hacktoberfest","java","kotlin","sdk"],"latest_commit_sha":null,"homepage":"https://appwrite.io","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appwrite.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-06-08T11:05:53.000Z","updated_at":"2026-02-05T22:06:09.000Z","dependencies_parsed_at":"2024-02-07T07:30:19.519Z","dependency_job_id":"c00f5752-eb71-498f-9eb7-b0c47f7278b7","html_url":"https://github.com/appwrite/sdk-for-android","commit_stats":{"total_commits":109,"total_committers":9,"mean_commits":12.11111111111111,"dds":0.5596330275229358,"last_synced_commit":"85fac9dedd90eefe8407382cdd9f54b436862703"},"previous_names":[],"tags_count":52,"template":false,"template_full_name":null,"purl":"pkg:github/appwrite/sdk-for-android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appwrite%2Fsdk-for-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appwrite%2Fsdk-for-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appwrite%2Fsdk-for-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appwrite%2Fsdk-for-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appwrite","download_url":"https://codeload.github.com/appwrite/sdk-for-android/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appwrite%2Fsdk-for-android/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29411141,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","appwrite","baas","firebase","hacktoberfest","java","kotlin","sdk"],"created_at":"2024-08-01T07:01:26.696Z","updated_at":"2026-02-13T15:18:37.953Z","avatar_url":"https://github.com/appwrite.png","language":"Kotlin","readme":"# Appwrite Android SDK\n\n![Maven Central](https://img.shields.io/maven-central/v/io.appwrite/sdk-for-android.svg?color=green\u0026style=flat-square)\n![License](https://img.shields.io/github/license/appwrite/sdk-for-android.svg?style=flat-square)\n![Version](https://img.shields.io/badge/api%20version-1.8.1-blue.svg?style=flat-square)\n[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)\n[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee\u0026label=twitter\u0026style=flat-square)](https://twitter.com/appwrite)\n[![Discord](https://img.shields.io/discord/564160730845151244?label=discord\u0026style=flat-square)](https://appwrite.io/discord)\n\n**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-android/releases).**\n\nAppwrite is an open-source backend as a service server that abstracts and simplifies 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)\n\n![Appwrite](https://github.com/appwrite/appwrite/raw/main/public/images/github.png)\n\n## Installation\n\n### Gradle\n\nAppwrite's Android SDK is hosted on Maven Central. In order to fetch the Appwrite SDK, add this to your root level `build.gradle(.kts)` file:\n\n```groovy\nrepositories {      \n    mavenCentral()\n}\n```\n\nIf you would like to fetch our SNAPSHOT releases, you need to add the SNAPSHOT maven repository to your `build.gradle(.kts)`:\n\n```groovy\nrepositories {\n    maven {\n        url \"https://s01.oss.sonatype.org/content/repositories/snapshots/\"\n    }\n}\n```\n\nNext, add the dependency to your project's `build.gradle(.kts)` file:\n\n```groovy\nimplementation(\"io.appwrite:sdk-for-android:12.1.0\")\n```\n\n### Maven\nAdd this to your project's `pom.xml` file:\n\n```xml\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003eio.appwrite\u003c/groupId\u003e\n        \u003cartifactId\u003esdk-for-android\u003c/artifactId\u003e\n        \u003cversion\u003e12.1.0\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n\n## Getting Started\n\n### Add your Android Platform\nTo initialize your SDK and start interacting with Appwrite services, you need to add a new Android platform to your project. To add a new platform, go to your Appwrite console, select your project (create one if you haven't already), and click the 'Add Platform' button on the project Dashboard.\n\nFrom the options, choose to add a new **Android** platform and add your app credentials.\n\nAdd your app \u003cu\u003ename\u003c/u\u003e and \u003cu\u003epackage name\u003c/u\u003e. Your package name is generally the applicationId in your app-level `build.gradle` file. By registering a new platform, you are allowing your app to communicate with the Appwrite API.\n\n### Registering additional activities\nIn order to capture the Appwrite OAuth callback url, the following activity needs to be added to your [AndroidManifest.xml](https://github.com/appwrite/playground-for-android/blob/master/app/src/main/AndroidManifest.xml). Be sure to replace the **[PROJECT_ID]** string with your actual Appwrite project ID. You can find your Appwrite project ID in your project settings screen in the console.\n\n```xml\n\u003cmanifest\u003e\n    \u003capplication\u003e\n        \u003cactivity android:name=\"io.appwrite.views.CallbackActivity\" \u003e\n            \u003cintent-filter android:label=\"android_web_auth\"\u003e\n                \u003caction android:name=\"android.intent.action.VIEW\" /\u003e\n                \u003ccategory android:name=\"android.intent.category.DEFAULT\" /\u003e\n                \u003ccategory android:name=\"android.intent.category.BROWSABLE\" /\u003e\n                \u003cdata android:scheme=\"appwrite-callback-\u003cPROJECT_ID\u003e\" /\u003e\n            \u003c/intent-filter\u003e\n        \u003c/activity\u003e\n    \u003c/application\u003e\n\u003c/manifest\u003e\n```\n\n### Init your SDK\n\n\u003cp\u003eInitialize your SDK with your Appwrite server API endpoint and project ID, which can be found in your project settings page.\n\n```kotlin\nimport io.appwrite.Client\nimport io.appwrite.services.Account\n\nval client = Client(context)\n  .setEndpoint(\"https://\u003cHOSTNAME_OR_IP\u003e/v1\") // Your API Endpoint\n  .setProject(\"\u003cPROJECT_ID\u003e\") // Your project ID\n  .setSelfSigned(true) // Remove in production\n```\n\nBefore 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.\n\nWhen trying to connect to Appwrite from an emulator or a mobile device, localhost is the hostname of the device or emulator and not your local Appwrite instance. You should replace localhost with your private IP. You can also use a service like [ngrok](https://ngrok.com/) to proxy the Appwrite API.\n\n### Make Your First Request\n\n\u003cp\u003eOnce 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](https://appwrite.io/docs) section.\n\n```kotlin\n// Register User\nval account = Account(client)\nval response = account.create(\n    ID.unique(),\n    \"email@example.com\",\n    \"password\",\n    \"Walter O'Brien\"\n)\n```\n\n### Full Example\n\n```kotlin\nimport io.appwrite.Client\nimport io.appwrite.services.Account\nimport io.appwrite.ID\n\nval client = Client(context)\n  .setEndpoint(\"https://\u003cHOSTNAME_OR_IP\u003e/v1\") // Your API Endpoint\n  .setProject(\"\u003cPROJECT_ID\u003e\") // Your project ID\n  .setSelfSigned(true) // Remove in production\n\nval account = Account(client)\nval user = account.create(\n    ID.unique(),\n    \"email@example.com\",\n    \"password\",\n    \"Walter O'Brien\"\n)\n```\n\n### Type Safety with Models\n\nThe Appwrite Android SDK provides type safety when working with database documents through generic methods. Methods like `listDocuments`, `getDocument`, and others accept a `nestedType` parameter that allows you to specify your custom model type for full type safety.\n\n**Kotlin:**\n```kotlin\ndata class Book(\n    val name: String,\n    val author: String,\n    val releaseYear: String? = null,\n    val category: String? = null,\n    val genre: List\u003cString\u003e? = null,\n    val isCheckedOut: Boolean\n)\n\nval databases = Databases(client)\n\ntry {\n    val documents = databases.listDocuments(\n        databaseId = \"your-database-id\",\n        collectionId = \"your-collection-id\",\n        nestedType = Book::class.java // Pass in your custom model type\n    )\n    \n    for (book in documents.documents) {\n        Log.d(\"Appwrite\", \"Book: ${book.name} by ${book.author}\") // Now you have full type safety\n    }\n} catch (e: AppwriteException) {\n    Log.e(\"Appwrite\", e.message ?: \"Unknown error\")\n}\n```\n\n**Java:**\n```java\npublic class Book {\n    private String name;\n    private String author;\n    private String releaseYear;\n    private String category;\n    private List\u003cString\u003e genre;\n    private boolean isCheckedOut;\n\n    // Constructor\n    public Book(String name, String author, boolean isCheckedOut) {\n        this.name = name;\n        this.author = author;\n        this.isCheckedOut = isCheckedOut;\n    }\n\n    // Getters and setters\n    public String getName() { return name; }\n    public void setName(String name) { this.name = name; }\n    \n    public String getAuthor() { return author; }\n    public void setAuthor(String author) { this.author = author; }\n    \n    public String getReleaseYear() { return releaseYear; }\n    public void setReleaseYear(String releaseYear) { this.releaseYear = releaseYear; }\n    \n    public String getCategory() { return category; }\n    public void setCategory(String category) { this.category = category; }\n    \n    public List\u003cString\u003e getGenre() { return genre; }\n    public void setGenre(List\u003cString\u003e genre) { this.genre = genre; }\n    \n    public boolean isCheckedOut() { return isCheckedOut; }\n    public void setCheckedOut(boolean checkedOut) { isCheckedOut = checkedOut; }\n}\n\nDatabases databases = new Databases(client);\n\ntry {\n    DocumentList\u003cBook\u003e documents = databases.listDocuments(\n        \"your-database-id\",\n        \"your-collection-id\",\n        Book.class // Pass in your custom model type\n    );\n    \n    for (Book book : documents.getDocuments()) {\n        Log.d(\"Appwrite\", \"Book: \" + book.getName() + \" by \" + book.getAuthor()); // Now you have full type safety\n    }\n} catch (AppwriteException e) {\n    Log.e(\"Appwrite\", e.getMessage() != null ? e.getMessage() : \"Unknown error\");\n}\n```\n\n**Tip**: You can use the `appwrite types` command to automatically generate model definitions based on your Appwrite database schema. Learn more about [type generation](https://appwrite.io/docs/products/databases/type-generation).\n\n### Working with Model Methods\n\nAll Appwrite models come with built-in methods for data conversion and manipulation:\n\n**`toMap()`** - Converts a model instance to a Map format, useful for debugging or manual data manipulation:\n```kotlin\nval account = Account(client)\nval user = account.get()\nval userMap = user.toMap()\nLog.d(\"Appwrite\", userMap.toString()) // Prints all user properties as a Map\n```\n\n**`from(map:, nestedType:)`** - Creates a model instance from a Map, useful when working with raw data:\n```kotlin\nval userData: Map\u003cString, Any\u003e = mapOf(\n    \"\\$id\" to \"123\",\n    \"name\" to \"John\",\n    \"email\" to \"john@example.com\"\n)\nval user = User.from(userData, User::class.java)\n```\n\n**JSON Serialization** - Models can be easily converted to/from JSON using Gson (which the SDK uses internally):\n```kotlin\nimport com.google.gson.Gson\n\nval account = Account(client)\nval user = account.get()\n\n// Convert to JSON\nval gson = Gson()\nval jsonString = gson.toJson(user)\nLog.d(\"Appwrite\", \"User JSON: $jsonString\")\n\n// Convert from JSON\nval userFromJson = gson.fromJson(jsonString, User::class.java)\n```\n\n### Error Handling\n\nThe Appwrite Android SDK raises an `AppwriteException` object with `message`, `code` and `response` properties. You can handle any errors by catching `AppwriteException` and present the `message` to the user or handle it yourself based on the provided error information. Below is an example.\n\n```kotlin\ntry {\n    var user = account.create(ID.unique(),\"email@example.com\",\"password\",\"Walter O'Brien\")\n    Log.d(\"Appwrite user\", user.toMap())\n} catch(e : AppwriteException) {\n    e.printStackTrace()\n}\n```\n\n### Learn more\nYou can use the following resources to learn more and get help\n- 🚀 [Getting Started Tutorial](https://appwrite.io/docs/getting-started-for-android)\n- 📜 [Appwrite Docs](https://appwrite.io/docs)\n- 💬 [Discord Community](https://appwrite.io/discord)\n- 🚂 [Appwrite Android Playground](https://github.com/appwrite/playground-for-android)\n\n\n## Contribution\n\nThis library is auto-generated by Appwrite custom [SDK Generator](https://github.com/appwrite/sdk-generator). To learn more about how you can help us improve this SDK, please check the [contribution guide](https://github.com/appwrite/sdk-generator/blob/master/CONTRIBUTING.md) before sending a pull-request.\n\n## License\n\nPlease see the [BSD-3-Clause license](https://raw.githubusercontent.com/appwrite/appwrite/master/LICENSE) file for more information.","funding_links":[],"categories":["SDK"],"sub_categories":["Official Appwrite SDKs"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappwrite%2Fsdk-for-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappwrite%2Fsdk-for-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappwrite%2Fsdk-for-android/lists"}