https://github.com/rommansabbir/parselivequery-android
A simple library for Parse LiveQuery in Android
https://github.com/rommansabbir/parselivequery-android
Last synced: about 2 months ago
JSON representation
A simple library for Parse LiveQuery in Android
- Host: GitHub
- URL: https://github.com/rommansabbir/parselivequery-android
- Owner: rommansabbir
- Created: 2019-02-24T04:57:38.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-07T05:13:42.000Z (about 6 years ago)
- Last Synced: 2025-01-30T15:16:52.224Z (4 months ago)
- Language: Java
- Homepage:
- Size: 125 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ParseLiveQuery-Android
## Documentation### Installation
---
Step 1. Add the JitPack repository to your build file```gradle
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
```Step 2. Add the dependency
```gradle
dependencies {
implementation 'com.github.rommansabbir:ParseLiveQuery-Android:Tag'
}
```---
### Version available
| Releases
| ------------- |
| v1.0.1 |
| v1.0 |# Usages
### For Java:
```java
public class MainActivity extends AppCompatActivity implements ParseLiveQuery.ParseLiveQueryInterface {
private ParseLiveQuery parseLiveQuery;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);/**
* Instantiate ParseLiveQuery
*/
parseLiveQuery = new ParseLiveQuery(this);/**
* Create a usual parse query, add some constraint if you want
* Don't execute the query
*/
ParseQuery liveQuery = ParseQuery.getQuery("CLASS_NAME");
liveQuery.whereGreaterThan("AGE", 25);/**
* Add live event listener to your query
* Provide the name of your app, pass the liveQuery to the live event listener
* @APP_NAME
* @liveQuery
*/
parseLiveQuery.addLiveEventListener("YOUR_APP_NAME_HERE", liveQuery);}
@Override
public void onEventListenerSuccess(ParseObject retrievedObject) {
//TODO implement your logic here}
@Override
public void onEventListenerFailure(String errorMessage) {
//TODO implement your logic here
}@Override
protected void onDestroy() {
super.onDestroy();
/**
* Destroy the callback after it usages
*/
parseLiveQuery.destroyCallback();
}
}
```### Contact me
[Portfolio](https://www.rommansabbir.com/) | [LinkedIn](https://www.linkedin.com/in/rommansabbir/) | [Twitter](https://www.twitter.com/itzrommansabbir/) | [Facebook](https://www.facebook.com/itzrommansabbir/)