{"id":29020395,"url":"https://github.com/appbaseio/appbase-droid","last_synced_at":"2025-06-26T01:05:34.239Z","repository":{"id":8583279,"uuid":"58910303","full_name":"appbaseio/appbase-droid","owner":"appbaseio","description":"Elasticsearch and appbase.io library for Android (and Java)","archived":false,"fork":false,"pushed_at":"2022-05-20T20:51:00.000Z","size":44648,"stargazers_count":24,"open_issues_count":7,"forks_count":1,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-06-19T03:06:40.544Z","etag":null,"topics":["android","appbase","elasticsearch","elasticsearch-client","java"],"latest_commit_sha":null,"homepage":"https://opensource.appbase.io/appbase-droid/doc/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/appbaseio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-16T06:51:53.000Z","updated_at":"2024-09-29T14:24:03.000Z","dependencies_parsed_at":"2022-08-25T08:50:46.986Z","dependency_job_id":null,"html_url":"https://github.com/appbaseio/appbase-droid","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/appbaseio/appbase-droid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appbaseio%2Fappbase-droid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appbaseio%2Fappbase-droid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appbaseio%2Fappbase-droid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appbaseio%2Fappbase-droid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/appbaseio","download_url":"https://codeload.github.com/appbaseio/appbase-droid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/appbaseio%2Fappbase-droid/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261978910,"owners_count":23239417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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","appbase","elasticsearch","elasticsearch-client","java"],"created_at":"2025-06-26T01:05:33.299Z","updated_at":"2025-06-26T01:05:34.217Z","avatar_url":"https://github.com/appbaseio.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# appbase-droid\n[![](https://api.travis-ci.org/appbaseio/appbase-droid.svg?branch=master)](https://travis-ci.org/appbaseio/appbase-droid)\n\nThe missing Android client for Elasticsearch and appbase.io.\n\n## Download\n\nDownload [the latest JAR](https://search.maven.org/remote_content?g=io.appbase\u0026a=appbase-droid\u0026v=LATEST) or configure this dependency:\n\nMaven:\n\n    \u003cdependency\u003e\n      \u003cgroupId\u003eio.appbase\u003c/groupId\u003e\n      \u003cartifactId\u003eappbase-droid\u003c/artifactId\u003e\n      \u003cversion\u003e1.2.0\u003c/version\u003e\n    \u003c/dependency\u003e\n\n\nGradle:\n\n    implementation(\"io.appbase:appbase-droid:1.2.0\")\n\nSnapshots of the development version are available in [Sonatype's `snapshots` repository](https://oss.sonatype.org/content/repositories/snapshots/).\n\n## Overview\n\n`appbase-droid` is an Elasticsearch client library usable from an Android device.\n\nWe built this as there are currently no good or maintained Elasticsearch libraries out there for Android.\n\nOur design goals in building `appbase-droid` are:\n1. Provide a lightweight library for querying right from Android (**1MB** in size),\n2. Maintain compatibility with Java so it can also be used as a lightweight Java alternative (**20x** lighter than the official Elasticsearch client library),\n3. Only support methods related to document and query DSL, ideally your Elasticsearch hosting environment comes with a read-only access.\n4. **Bonus:** Support for streaming data queries when Elasticsearch is hosted on appbase.io app; build live charts, newsfeeds, streaming search.\n\n## Quick Start\n\n- **Creating the client**\n\n    ```java\n    AppbaseClient client = new AppbaseClient(url, appname, username, password);\n    ```\n**Note:** If you are hosting with appbase.io the url should be \"https://scalr.api.appbase.io\". The username should refer to the first part of the API credentials, and the password as the second part of it. You can get an idea on how to map the appname, username, password by viewing [this GIF](http://g.recordit.co/hXczegy4cH.gif).\n\n- **Index a document**\n\n    ```java\n    String result = client.prepareIndex(type, id, body)\n      .execute()\n      .body()\n      .string();\n    System.out.println(result);\n    ```\n    \n    Sample Output:\n    \n    ```json\n    {\n      \"_index\": \"droid-test\",\n      \"_type\": \"_doc\",\n      \"_id\": \"xvvooe\",\n      \"_version\": 1,\n      \"result\": \"created\",\n      \"_shards\": {\n        \"total\": 2,\n        \"successful\": 2,\n        \"failed\": 0\n      },\n      \"_seq_no\": 18,\n      \"_primary_term\": 3\n    }\n    ```\n\n- **Update a document**\n\n    ```java\n    String result = client.prepareUpdate(type, id, parameters, doc)\n      .execute()\n      .body()\n      .string();\n    System.out.println(result);\n    ```\n    \n    Sample Output:\n    \n    ```json\n    {\n      \"_index\": \"droid-test\",\n      \"_type\": \"_doc\",\n      \"_id\": \"eqsrxtmggk\",\n      \"_version\": 2,\n      \"result\": \"updated\",\n      \"_shards\": {\n        \"total\": 2,\n        \"successful\": 2,\n        \"failed\": 0\n      },\n      \"_seq_no\": 26,\n      \"_primary_term\": 3\n    }\n    ```\n\n- **Delete a document**\n\n    ```java\n    String result = client.prepareDelete(type, id)\n      .execute()\n      .body()\n      .string();\n    ```\n    Sample Output:\n    \n    ```json\n    {\n      \"_index\": \"droid-test\",\n      \"_type\": \"_doc\",\n      \"_id\": \"smemya\",\n      \"_version\": 3,\n      \"result\": \"deleted\",\n      \"_shards\": {\n        \"total\": 2,\n        \"successful\": 2,\n        \"failed\": 0\n      },\n      \"_seq_no\": 26,\n      \"_primary_term\": 3\n    }\n    ```\n\n- **Get a document**\n\n    ```java\n    String result = client.prepareGet(type, id)\n      .execute()\n      .body()\n      .string();\n    ```\n    Sample Output:\n    \n    ```json\n    {\n      \"_index\": \"droid-test\",\n      \"_type\": \"_doc\",\n      \"_id\": \"nvyxcec\",\n      \"found\": false\n    }\n    ```\n\n- **Make a search request**\n    ```java\n    String query =  \"{ \\\"query\\\": { \\\"term\\\": { \\\"price\\\": \\\"100\\\" } } }\";\n    String result = client.prepareSearch(type, query)\n      .execute()\n      .body()\n      .string();\n    ```\n    Sample Output:\n    \n    ```json\n    {\n      \"took\": 0,\n      \"timed_out\": false,\n      \"_shards\": {\n        \"total\": 5,\n        \"successful\": 5,\n        \"skipped\": 0,\n        \"failed\": 0\n      },\n      \"hits\": {\n        \"total\": 1,\n        \"max_score\": 1.0,\n        \"hits\": [\n          {\n            \"_index\": \"droid-test\",\n            \"_type\": \"_doc\",\n            \"_id\": \"bkxfsvddmo\",\n            \"_score\": 1.0,\n            \"_source\": {\n              \"department_id\": 1,\n              \"price\": 5,\n              \"department_name\": \"Books\",\n              \"name\": \"A Fake Book on Network Routing\"\n            }\n          }\n        ]\n      }\n    }\n    ```\n\n## Documentation Reference\n\nA brief primer on the supported methods.\n\nSee the [online documentation reference](https://opensource.appbase.io/appbase-droid/doc/).\n\n## Example\n\nCheckout [an example app](https://github.com/appbaseio-apps/AndroidSampleApp) built with `appbase-droid`.\n\n## How To Run Locally\n\n### Clone\n\n`git clone https://github.com/appbaseio/appbase-droid`\n\n### Testing\n\n```\nmvn test\n```\n\nwill test all the supported methods.\n\n### Developing\n\nThe codebase resides under the `src/main/java/io/appbase` path.\n\n* `src/main/java/io/appbase/client` contains the main interface methods.\n* `src/main/java/io/appbase/requestbuilders` contains utility methods for supporting an Elasticsearch Java client like request builder functionality.\n* `src/main/java/io/appbase/interceptor` contains a simple utility for supporting Basic Auth authentication.\n* `src/main/java/io/appbase/trial` contains a sample code that uses the library.\n\nTest files reside under `src/test/java/test` path.\n\n* `src/test/java/test/AppbaseTest` is the main test file that currently tests 7 methods. It is also a good place to see the library usage.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappbaseio%2Fappbase-droid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fappbaseio%2Fappbase-droid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fappbaseio%2Fappbase-droid/lists"}