S sconlon Active Member Licensed User Longtime User Nov 14, 2012 #1 When the user closes my app I want to backup the database by FTP'ing it to a website. I already have an FTP service that runs when the app starts so I can use it to do the backup. But I want to ask what is the best way to ensure that the service completes the FTP upload before I close the app (by doing an Activity.Finish in Main) and thereby stop the FTP service. Or am I misunderstanding the process life-cycle and the service will run to completion regardless of the main module - this does not seem to happen for me at the moment. Ta.
When the user closes my app I want to backup the database by FTP'ing it to a website. I already have an FTP service that runs when the app starts so I can use it to do the backup. But I want to ask what is the best way to ensure that the service completes the FTP upload before I close the app (by doing an Activity.Finish in Main) and thereby stop the FTP service. Or am I misunderstanding the process life-cycle and the service will run to completion regardless of the main module - this does not seem to happen for me at the moment. Ta.
Erel B4X founder Staff member Licensed User Longtime User Nov 14, 2012 #2 Services are not killed when activities are closed. However you should call Service.StartForeground if you want to make sure that Android doesn't kill the process because it is low on memory. Upvote 0
Services are not killed when activities are closed. However you should call Service.StartForeground if you want to make sure that Android doesn't kill the process because it is low on memory.
S sconlon Active Member Licensed User Longtime User Nov 14, 2012 #3 Thanks Erel, a timely reply as always. Upvote 0