How do I use real-time data query

I found the official documentation and searched on the video station, but I didn’t find detailed data in real time. What is the code for querying data in real time? Are there any examples you can refer to?

Have you already tried this guide?

Yes, but I need an Android Guide
and thanks

I think there is no official guide for Android Live Query. But you can take a look at this example project and at this guide. I hope it helps.

Well, thank you
Thank you for your advice. I don’t know why there is no such tutorial on YouTube

ParseLiveQueryClient parseLiveQueryClient = ParseLiveQueryClient.Factory.getClient();
        //mPosts.clear();
        ParseQuery<ParseObject> query = ParseQuery.getQuery("Post");
        // Connect to Parse server
        SubscriptionHandling<ParseObject> subscriptionHandling = parseLiveQueryClient.subscribe(query);
        // Listen for CREATE events
        subscriptionHandling.handleEvent(SubscriptionHandling.Event.UPDATE, new SubscriptionHandling.HandleEventCallback<ParseObject>() {
            @Override
            public void onEvent(ParseQuery<ParseObject> query, ParseObject object) {

                Handler handler = new Handler(Looper.getMainLooper());
                handler.post(new Runnable() {
                    @Override
                    public void run() {
                        queryPosts();
                    }

                });
            }
        });

Do you think I’m right in this way?

there will be one in the near future for android (using kotlin as programming language)
i will reply to this thread again once its uploaded on Youtube

Thank you. I hope we can use Java as well.

Your code looks good. Is it not working as expected? Do you have any error message? What is not working?

No error messages, but it doesn’t work

Could you share your Parse Server configuration settings for Live Query?

Do you want to see the server-side configuration?

I don’t know how to configure the server

Where are you running your Parse Server? For Parse Live Query you should have something like this: https://docs.parseplatform.org/parse-server/guide/#scalability

I am running on the server. The SDK I added is:
implementation ‘com.github.parse-community.Parse-SDK-Android:parse:1.20.0’
implementation ‘com.github.parse-community:ParseLiveQuery-Android:1.1.0’
Is this correct?

You need to make sure that you have something like this in your server.