Android Question How to wait till a http job is done

Discussion in 'Android Questions' started by Alberto Michelis, Jun 28, 2015.

  1. Alberto Michelis

    Alberto Michelis Active 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
     
  2. imbault

    imbault Well-Known Member Licensed User

    You can do a simple thing:
    Before to invoke your Web Service call just a :
    Code:
    Dim cMessage as string = "Please wait..."  ' Or whatever more consistent

    ProgressDialogShow(cMessage)
    and in JobDone, you just add:
    Code:
    ProgressDialogHide
     
    Erel and DonManfred like this.
  3. Alberto Michelis

    Alberto Michelis Active Member Licensed User

  4. b4auser1

    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.
    Code:
    Dim cMessage as string = "Please wait..."  ' Or whatever more consistent
    InProgress = True
    ProgressDialogShow(cMessage)
    Code:
    ProgressDialogHide
    InProgress = 
    False
     
  5. yashwant

    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
     
  6. eurojam

    eurojam Well-Known Member Licensed User

    please post some code, then it will be easier to help you...
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    Please start a new thread for your question.
     
  8. 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
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice