imgsimonebiliato Well-Known Member Licensed User Longtime User Jun 26, 2015 #1 Hello, I use a service to do a request http to a web server. I need to execute this request, even when the user exit from the app. How can I do?
Hello, I use a service to do a request http to a web server. I need to execute this request, even when the user exit from the app. How can I do?
imgsimonebiliato Well-Known Member Licensed User Longtime User Jun 26, 2015 #21 qsrtech said: I think setting startatboot:true in the service's settings at the very top of the code module should do what you want. Click to expand... No, don't work Upvote 0
qsrtech said: I think setting startatboot:true in the service's settings at the very top of the code module should do what you want. Click to expand... No, don't work
Q qsrtech Active Member Licensed User Longtime User Jun 26, 2015 #22 Did you set it to true and restart your device? Seems to work for me. And that will just start the service. You still have the issue of calling your "activity" sub... Upvote 0
Did you set it to true and restart your device? Seems to work for me. And that will just start the service. You still have the issue of calling your "activity" sub...
imgsimonebiliato Well-Known Member Licensed User Longtime User Jun 26, 2015 #23 qsrtech said: Did you set it to true and restart your device? Seems to work for me. And that will just start the service. You still have the issue of calling your "activity" sub... Click to expand... Can you post me your service code? Upvote 0
qsrtech said: Did you set it to true and restart your device? Seems to work for me. And that will just start the service. You still have the issue of calling your "activity" sub... Click to expand... Can you post me your service code?
Q qsrtech Active Member Licensed User Longtime User Jun 26, 2015 #24 imgsimonebiliato said: Can you post me your service code? Click to expand... Mine is very similar. I have a timer that fires 10 seconds after the service starts which then starts my "main" activity. The sole purpose of that particular service is to in effect have a launch at boot app. Upvote 0
imgsimonebiliato said: Can you post me your service code? Click to expand... Mine is very similar. I have a timer that fires 10 seconds after the service starts which then starts my "main" activity. The sole purpose of that particular service is to in effect have a launch at boot app.
imgsimonebiliato Well-Known Member Licensed User Longtime User Jun 26, 2015 #25 But do you start the main activity every time? Upvote 0
Q qsrtech Active Member Licensed User Longtime User Jun 26, 2015 #26 imgsimonebiliato said: But do you start the main activity every time? Click to expand... In that particular case it just launches the main app at boot and turns off the timer. I realize you have code you want to execute in your activity, that's a whole other issue. I was just replying to your question about starting your service when the device is "powered on". Is it possible to move the code you want to run to the service? I'm not sure putting it in a code module will help since I don't believe you can use "callsub" for a code module, unless somethings been improved without my knowledge Upvote 0
imgsimonebiliato said: But do you start the main activity every time? Click to expand... In that particular case it just launches the main app at boot and turns off the timer. I realize you have code you want to execute in your activity, that's a whole other issue. I was just replying to your question about starting your service when the device is "powered on". Is it possible to move the code you want to run to the service? I'm not sure putting it in a code module will help since I don't believe you can use "callsub" for a code module, unless somethings been improved without my knowledge
thedesolatesoul Expert Licensed User Longtime User Jun 26, 2015 #27 qsrtech said: I don't believe you can use "callsub" for a code module Click to expand... You dont need to as a code module is static. (There is no context for the module). Just do CodeModule.CodeSub(CodeParams) Upvote 0
qsrtech said: I don't believe you can use "callsub" for a code module Click to expand... You dont need to as a code module is static. (There is no context for the module). Just do CodeModule.CodeSub(CodeParams)