{"id":28438129,"url":"https://github.com/parse-community/parselivequery-android","last_synced_at":"2025-06-28T15:31:30.807Z","repository":{"id":45947728,"uuid":"68854119","full_name":"parse-community/ParseLiveQuery-Android","owner":"parse-community","description":"Parse LiveQuery client for Android.","archived":false,"fork":false,"pushed_at":"2022-12-22T19:31:17.000Z","size":218,"stargazers_count":84,"open_issues_count":26,"forks_count":32,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-06-25T16:33:22.351Z","etag":null,"topics":["livequery-clients","parse-live-query","parse-platform"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parse-community.png","metadata":{"funding":{"github":"parse-community","patreon":null,"open_collective":"parse-server","ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null},"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-21T20:16:57.000Z","updated_at":"2024-01-29T21:18:49.000Z","dependencies_parsed_at":"2023-01-30T16:30:51.853Z","dependency_job_id":null,"html_url":"https://github.com/parse-community/ParseLiveQuery-Android","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/parse-community/ParseLiveQuery-Android","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parse-community%2FParseLiveQuery-Android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parse-community%2FParseLiveQuery-Android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parse-community%2FParseLiveQuery-Android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parse-community%2FParseLiveQuery-Android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parse-community","download_url":"https://codeload.github.com/parse-community/ParseLiveQuery-Android/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parse-community%2FParseLiveQuery-Android/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262452284,"owners_count":23313412,"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":["livequery-clients","parse-live-query","parse-platform"],"created_at":"2025-06-06T00:39:20.415Z","updated_at":"2025-06-28T15:31:30.802Z","avatar_url":"https://github.com/parse-community.png","language":"Java","funding_links":["https://github.com/sponsors/parse-community","https://opencollective.com/parse-server"],"categories":[],"sub_categories":[],"readme":"# Parse LiveQuery Client for Android\n[![License][license-svg]][license-link] [![Build Status][build-status-svg]][build-status-link] [![](https://jitpack.io/v/parse-community/ParseLiveQuery-Android.svg)](https://jitpack.io/#parse-community/ParseLiveQuery-Android)\n\n`ParseQuery` is one of the key concepts for Parse. It allows you to retrieve `ParseObject`s by specifying some conditions, making it easy to build apps such as a dashboard, a todo list or even some strategy games. However, `ParseQuery` is based on a pull model, which is not suitable for apps that need real-time support.\n\nSuppose you are building an app that allows multiple users to edit the same file at the same time. `ParseQuery` would not be an ideal tool since you can not know when to query from the server to get the updates.\n\nTo solve this problem, we introduce Parse LiveQuery. This tool allows you to subscribe to a `ParseQuery` you are interested in. Once subscribed, the server will notify clients whenever a `ParseObject` that matches the `ParseQuery` is created or updated, in real-time.\n\n## Setup Server\n\nParse LiveQuery contains two parts, the LiveQuery server and the LiveQuery clients. In order to use live queries, you need to set up both of them.\n\nThe easiest way to setup the LiveQuery server is to make it run with the [Open Source Parse Server](https://github.com/parse-community/parse-server/wiki/Parse-LiveQuery#server-setup).\n\n## Dependency\n\nAdd this in your root `build.gradle` file (**not** your module `build.gradle` file):\n\n```gradle\nallprojects {\n\trepositories {\n\t\t...\n\t\tmaven { url \"https://jitpack.io\" }\n\t}\n}\n```\n\nThen, add the library to your project `build.gradle`\n```gradle\ndependencies {\n    implementation 'com.github.parse-community:ParseLiveQuery-Android:latest.version.here'\n}\n```\n\n## Use Client\n\nThe LiveQuery client interface is based around the concept of `Subscriptions`. You can register any `ParseQuery` for live updates from the associated live query server, by simply calling `subscribe()` on the client:\n```java\n// Parse.initialize should be called first\n\nParseLiveQueryClient parseLiveQueryClient = ParseLiveQueryClient.Factory.getClient();\n```\n\n### Creating Live Queries\n\nLive querying depends on creating a subscription to a `ParseQuery`:\n\n```java\nParseQuery\u003cMessage\u003e parseQuery = ParseQuery.getQuery(Message.class);\n\nSubscriptionHandling\u003cParseObject\u003e subscriptionHandling = parseLiveQueryClient.subscribe(parseQuery)\n```\n\nOnce you've subscribed to a query, you can `handle` events on them, like so:\n```java\nsubscriptionHandling.handleEvents(new SubscriptionHandling.HandleEventsCallback\u003cParseObject\u003e() {\n    @Override\n    public void onEvents(ParseQuery\u003cParseObject\u003e query, SubscriptionHandling.Event event, ParseObject object) {\n        // HANDLING all events\n    }\n})\n```\n\nYou can also handle a single type of event, if that's all you're interested in:\n```java\nsubscriptionHandling.handleEvent(SubscriptionHandling.Event.CREATE, new SubscriptionHandling.HandleEventCallback\u003cParseObject\u003e() {\n    @Override\n    public void onEvent(ParseQuery\u003cParseObject\u003e query, ParseObject object) {\n        // HANDLING create event\n    }\n})\n```\n\nHandling errors is and other events is similar, take a look at the `SubscriptionHandling` class for more information.\n\n## Advanced Usage\n\nIf you wish to pass in your own OkHttpClient instance for troubleshooting or custom configs, you can instantiate the client as follows:\n\n```java\nParseLiveQueryClient parseLiveQueryClient = ParseLiveQueryClient.Factory.getClient(new OkHttp3SocketClientFactory(new OkHttpClient()));\n```\n\nThe URL is determined by the Parse initialization, but you can override by specifying a `URI` object:\n\n```java\nParseLiveQueryClient parseLiveQueryClient = ParseLiveQueryClient.Factory.getClient(new URI(\"wss://myparseinstance.com\"));\n```\n\nNote: The expected protocol for URI is `ws` instead of `http`, like in this example: `URI(\"ws://192.168.0.1:1337/1\")`.\n\n## How Do I Contribute?\nWe want to make contributing to this project as easy and transparent as possible. Please refer to the [Contribution Guidelines](https://github.com/parse-community/Parse-SDK-Android/blob/master/CONTRIBUTING.md).\n\n-----\n\nAs of April 5, 2017, Parse, LLC has transferred this code to the parse-community organization, and will no longer be contributing to or distributing this code.\n\n [build-status-svg]: https://travis-ci.org/parse-community/ParseLiveQuery-Android.svg?branch=master\n [build-status-link]: https://travis-ci.org/parse-community/ParseLiveQuery-Android\n\n [license-svg]: https://img.shields.io/badge/license-BSD-lightgrey.svg\n [license-link]: https://github.com/parse-community/ParseLiveQuery-Android/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparse-community%2Fparselivequery-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparse-community%2Fparselivequery-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparse-community%2Fparselivequery-android/lists"}