Android Question several execute commands on start service,

wmardian

Member
Licensed User
Longtime User
Dear All,
I have a service that call a sub on service start. In the sub, there are several command to execute certain work.. please see the detail below;

B4X:
Sub Service_Start (StartingIntent As Intent)
    SynchIt
End Sub


Sub SynchIt
    Try
        ExecuteRemoteQuery("SELECT * FROM ..", ABC)
        ToastMessageShow("Updating RA",False)
    Catch
        Msgbox(LastException,"Error update RA")
    End Try
  
    Try
        ExecuteRemoteQuery("SELECT * FROM ..", DEF)
        ToastMessageShow("Updating TF",False)
    Catch
        Msgbox(LastException,"Error update TF")
    End Try
  
    Try
        ExecuteRemoteQuery("SELECT * FROM  ..", GHI)
        ToastMessageShow("Updating F",False)
    Catch
        Msgbox(LastException,"Error update F")
    End Try
  
    Try
        ExecuteRemoteQuery("SELECT * FROM ..", JKL)
        ToastMessageShow("Updating U",False)
    Catch
        Msgbox(LastException,"Error update U")
    End Try
  
    Try
        ExecuteRemoteQuery("SELECT * FROM ..", MNO)
        ToastMessageShow("Updating RF",False)
    Catch
        Msgbox(LastException,"Error update RF")
    End Try
  
    Try
        ExecuteRemoteQuery("SELECT * FROM ..", PQR)
        ToastMessageShow("Updating DF",False)
    Catch
        Msgbox(LastException,"Error update DF")
    End Try
  
    CallSubDelayed(ToolActivity,"TerminateServiceUpdateData")
  

  
End Sub

As you can see.. that sub SynchIt call ExcecuteRemoteQuery sub several times.
My question is;

how the service execute the ExecuteRemoteQuery sub?
Does the service wait the ABC finish and then execute the next DEF ?

or the service execute all "ExecuteRemoteQuery sub" one time, and does not wait http job ABC to execute DEF?

ExecuteRemoteQuery is a sub that generate http job to download data from mysql database. It is from Erel's sample to connect to MySql?

I hope i can explain it clearly..
Looking forward to hear from you all.. Thank in advance
Best Regards
 

derez

Expert
Licensed User
Longtime User
The jobs will be performed without waiting. If you want to do DEF only after ABC is done, call it from the job_done of ABC.
 
Upvote 0

wmardian

Member
Licensed User
Longtime User
Dear derez,
Many thanks.. i manage to execute the command after previous one finish.. and it works..

Dear Erel,
many thanks for your advice.. will soon remove it..

Thanks a lot guys..
Anyway, i have another issue now.. (
Will soon post a new question...


Rgds
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…