Android Question How to wait till a http job is done

Alberto Michelis

Well-Known Member
Licensed User
Hi,
When the app starts and before anything I need to retreive some data from a web server.
Im doing it ok but...
How can I wait till the http job is done ?
I need to show some waiting to connect message and to wait till the job is done.
Thanks
 

imbault

Well-Known Member
Licensed User
You can do a simple thing:
Before to invoke your Web Service call just a :
B4X:
Dim cMessage as string = "Please wait..."  ' Or whatever more consistent

ProgressDialogShow(cMessage)
and in JobDone, you just add:
B4X:
ProgressDialogHide
 

b4auser1

Well-Known Member
Licensed User
Also you can add a variable Dim InProgress As Boolean to check in other parts of your application, whether a web service call finished.
B4X:
Dim cMessage as string = "Please wait..."  ' Or whatever more consistent
InProgress = True
ProgressDialogShow(cMessage)
If InProgress Then ... Else ... End If
B4X:
ProgressDialogHide
InProgress = False
 

yashwant

Member
Licensed User
Hello

I am using For... Next Loop Statement In App to Insert Record On Web Server from sqlite database. But before finishing first job done Event Loop Statement finished and only One Statement get updated on Web server out of say Five Record.
I tried using In progress = true before insert Query but still Loop Completes and only One Record get inserted on Web Server.

Please help me.

Regards
Yashwant
 

yashwant

Member
Licensed User
Thanks eurojam for immediate response.
I have tried with Declaring HTTPJob In insert Query Procedure instead of global and it worked perfectly.

Thanks

Regards
yashwant
 
Top