Android Question Is there any way to wait for ExecuteRemoteQuery to be processed?

Oscarillo

New Member
As the title says.
I have this code.
B4X:
        dim variable as boolean = False
        ExecuteRemoteQuery(my_query, USER)
        Sleep(300)    'I use the pause to wait for a response, but sometimes it is not enough.
        If variable=True Then    'The variable changes its value on JobDone depending on the result
            ExecuteRemoteQuery(my_next_query,OTHERS)
        End If

Is there any other way instead of using the sleep?
Thanks for any response
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I guess that you aren't using the recommended jRDC2: https://www.b4x.com/android/forum/t...-rdc-remote-database-connector.61801/#content
It is built to be called with Wait For.

I'm not sure how ExecuteRemoteQuery is implemented, however you can do something like:
B4X:
ExecuteRemoteQuery(my_query, USER)
Do While variable = False
 Sleep(50)
Loop

This code will fail if you are making more than a single request at a time. There are better ways to implement this.
 
Upvote 0

Oscarillo

New Member
I guess that you aren't using the recommended jRDC2: https://www.b4x.com/android/forum/t...-rdc-remote-database-connector.61801/#content
It is built to be called with Wait For.

I'm not sure how ExecuteRemoteQuery is implemented, however you can do something like:
B4X:
ExecuteRemoteQuery(my_query, USER)
Do While variable = False
 Sleep(50)
Loop

This code will fail if you are making more than a single request at a time. There are better ways to implement this.
Thanks for the response and recommendation.
 
Upvote 0
Top