parse-community / Parse-SDK-Android

The Android SDK for Parse Platform
https://parseplatform.org/
Other
1.88k stars 735 forks source link

LiveQuery for Android #437

Closed Eke closed 7 years ago

Eke commented 8 years ago

Hello,

Is there any plan to add live query support for android sdk like in ios sdk?

nlutsenko commented 8 years ago

Hey @Eke, the plan is definitely there and we are working on it. Unfortunately we don't have a precise date on when it's going to launch.

We'll update this issue when we have more details.

TGIO commented 8 years ago

So there is no point for implementing it and making PR ?

nlutsenko commented 8 years ago

@TGIO, we can work on it together! Absolutely! We have a work-in-progress implementation for this right now, but it's not ready, but we would love to get the contribution on it.

Going to talk to @richardjrossiii about making the current state of the live query public and we'll update this issue with the link...

TGIO commented 8 years ago

@nlutsenko Well, i've got it working too :) But i'm not sure about design decisions i've made.

nlutsenko commented 8 years ago

Share the link? We can combine the effort!

TGIO commented 8 years ago

Will share as soon as i wrap it.

TGIO commented 8 years ago

@nlutsenko simplest POC

xxzulaxx commented 8 years ago

Please do share guys, thank you for the hard work. This is last item on the list before i am done with migration.

JeremyPlease commented 8 years ago

@TGIO Thanks for putting together that POC! What are the current limitations with your implementation?

@nlutsenko @richardjrossiii Any update on releasing what you guys are working on?

TGIO commented 8 years ago

@JeremyPlease no limitations so far. Going to use it in production soon.

There is one problem though. I didn't understand usage of "requestId" quite well and found no definition of it.

JeremyPlease commented 8 years ago

@TGIO Awesome--thanks!

If you have a moment, could you please share a little code snippet here on how to use?

TGIO commented 8 years ago

this is very raw example, but it proves that this is possible

JeremyPlease commented 8 years ago

@TGIO Nice. That's plenty. Sorry I didn't look in the starter folder first!

TGIO commented 8 years ago

@nlutsenko any updates ?

@JeremyPlease was it useful for you ?

JeremyPlease commented 8 years ago

@TGIO We haven't used your code yet. I'll let you know when we do though.

benitech commented 8 years ago

no release date yet?

TGIO commented 8 years ago

update #480

TGIO commented 8 years ago

update Library

khirr commented 8 years ago

Hi @TGIO, I've make some changes to can work with subscription easily, maybe you can use it and merge with you library: https://github.com/khirr/ParseLiveQuery

TGIO commented 8 years ago

@khirr Hi, awsome. Will check it out and try to merge. Thank you.

lifeisfunny commented 8 years ago

android ? anyupdate?

zouzoux commented 8 years ago

Hopefully it wont take too much time!

Onwa1kenobi commented 8 years ago

Still waiting for the official release.

aleshu commented 8 years ago

@nlutsenko Are you still working on this? If not, would you please share your code so it can be continued on github? Thanks!

khirr commented 8 years ago

@aleshu Hi, his code is already on github.

aleshu commented 8 years ago

Thanks mate, but I've only seen yours and TGIO's implementations (which are very good), but nothing from an official channel.

nlutsenko posted:

We have a work-in-progress implementation for this right now, but it's not ready, but we would love to get the contribution on it. Going to talk to richardjrossiii about making the current state of the live query public and we'll update this issue with the link...

I wish they could make it public as-is; it's been a while now and I fear the project has been abandoned.

benitech commented 8 years ago

yea, doesn't seem to be much going on in the "Android-SDK" repo at all. Doesn't make sense to use any feature which is released for iOS and almost 4 months later has no compatibility with Android.

If it continues like this, better consider other options.

khirr commented 8 years ago

Hi, I just added new options to https://github.com/khirr/ParseLiveQuery

Any feedback is appreciated.

TGIO commented 8 years ago

@khirr what do u think about merging ?

khirr commented 8 years ago

Hi @TGIO, yes for sure, you can merge it, then I can send you commits, I'm just learning how does git works haha.

TGIO commented 8 years ago

@khirr try to make a pull request into my lib so i can merge it

khirr commented 8 years ago

@TGIO Ok, I'm going to try it.

khirr commented 8 years ago

@TGIO pull request sent.

cagdasalagoz commented 8 years ago

So? Is is live now?

TGIO commented 8 years ago

@cagdasalagoz our (3rd party) library is ready for use

tofutim commented 8 years ago

Seems that Parse (at least client side) has been abandoned by Parse.

flovilmart commented 8 years ago

There is some effort that we put in our our side as well and we'll likely release something officialy on that org soon.

ghost commented 7 years ago

Sound great @flovilmart

jhansche commented 7 years ago

@nlutsenko @richardjrossiii @TGIO What's the current plan/expectation of this? Will @TGIO's implementation be pulled into the ParsePlatform org, and be officially maintained somehow? Any reason the official project hasn't been published yet?

flovilmart commented 7 years ago

There is an implementation about to be open on the parseplatform org, in the meantime you can use TGIO's

pdkcoder commented 7 years ago

How is it going mate? Any official update?

pirakleous commented 7 years ago

Any news?

queiroz commented 7 years ago

There hasn't been much movement here for a while, I was also wondering of when Live Query will be officially supported by the Parse Android SDK!

fadwafb commented 7 years ago

Hello guys ! I just wanted to share a good news with you. capture https://parseplatform.github.io/docs/parse-server/guide/#live-queries

rogerhu commented 7 years ago

So there actually is a work in progress and I think we're closer than most people think.

The Live Query protocol is already built on parse-server, so it's a matter of handling the create, update, leave, and delete events (see https://github.com/ParsePlatform/parse-server/wiki/Parse-LiveQuery-Protocol-Specification) and subscribing/unsubscribing to certain Parse queries.

Nonetheless, the goal is to get stuff parity with the iOS branch. It's a not a lot of code (https://github.com/ParsePlatform/ParseLiveQuery-iOS-OSX/blob/master/Sources/ParseLiveQuery/) and should be doable. Most of the work is implemented here: https://github.com/ParsePlatform/ParseLiveQuery-iOS-OSX/blob/master/Sources/ParseLiveQuery/Subscription.swift

Test app here to help showcase the behavior: https://github.com/ParsePlatform/ParseLiveQuery-Android/pull/16/files

Here are my observations of the current work:

There are two implementations in flight, one located at https://github.com/TGIO/ParseLiveQuery and one at https://github.com/ParsePlatform/ParseLiveQuery-Android.

1) https://github.com/ParsePlatform/ParseLiveQuery-Android needs an update to v1.14.0 (see https://github.com/ParsePlatform/ParseLiveQuery-Android/pull/11). We made a breaking change to how JSON data gets parsed.

2) TGIO uses Rx to send to bus events (https://github.com/TGIO/ParseLiveQuery/blob/master/parse-livequery/src/main/java/tgio/parselivequery/RxBus.java). Obviously the use of RxJava becomes problematic especially if your app had to choose between RxJava 1 vs RxJava 2. I'm not sure we should be using it.

3) Similar to the iOS version, https://github.com/ParsePlatform/ParseLiveQuery-Android tries to use ParseQuery to subscribe to bus events. There are some issues if you have a ParseQuery that uses order by semantics (see https://github.com/ParsePlatform/ParseLiveQuery-Android/issues/14). I think we may need our own Parse encoding/decoding as it's done in the iOS version (https://github.com/ParsePlatform/ParseLiveQuery-iOS-OSX/blob/master/Sources/ParseLiveQuery/Internal/QueryEncoder.swift)

4) TGIO uses a BaseQuery. The type of query events you can subscribe may be very limiting?

5) https://github.com/ParsePlatform/ParseLiveQuery-Android uses TubeSocket library for web socket. I think it should just be deprecated for OkHttp's websockets (see https://github.com/ParsePlatform/ParseLiveQuery-Android/issues/13), which the TGIO library already uses. There appears to be reconnect logic already as discussed here

Both appear to be proof of concepts though appear to work fine. I'm curious how we can reconcile the implementations to combine the best of both worlds?

flovilmart commented 7 years ago

@mmimeault, what do you think?

mmimeault commented 7 years ago

I think that https://github.com/ParsePlatform/ParseLiveQuery-Android is more than a WIP, as some people are already using it in production.

Of course, like @rogerhu said, it may need some updates. But its API is exactly the same as the iOS app. It will be easier to support this implementation as the code is also similar to the iOS impl.

I haven't checked the TGIO implementation, so I don't know anything about it. My vote will, of course, go to the one I implemented, I'm not impartial at all here.

I will continue to support it as we use it in production where I work. I will try to attack soon the most important issues that @rogerhu raised.

Thanks.

rogerhu commented 7 years ago

Great! I suggest we publish the info on the http://parseplatform.org/docs/android/guide/ as soon as you think it's ready.

For instance, http://docs.back4app.com/docs/android/live-query/ is using the TGIO library. I don't think most people realize that there is an official one being maintained.

rogerhu commented 7 years ago

Docs being updated: https://github.com/ParsePlatform/docs/pull/420/files

v1.0.1 release is released and being propagated through Maven Central (may take a few hours), which includes a bunch of improvements (including addressing all issues previously listed.)