I'm new in B4XPages. Please correct me if I wrong - I started the sync with my webservice. Before the sync finishes the user clicks on Home button and the Activity_Pause event fired. The app goes into background and the sync stops. Or am I wrong?
Why not make the sync service be a foreground service, so when the sync starts, you will see a notifiction (maybe something like "Syncing...") in the status bar even if the user clicks the home button.
Then when the sync service is done, it terminates and the notification goes away.
Why not make the sync service be a foreground service, so when the sync starts, you will see a notifiction (maybe something like "Syncing...") in the status bar even if the user clicks the home button.
Then when the sync service is done, it terminates and the notification goes away.
Thank you for the advice. Will it work only with B4XPages or not? I don't have time now to rewrite the whole app to B4XPages. Also - will it work with Android 13?
Thank you for the advice. Will it work only with B4XPages or not? I don't have time now to rewrite the whole app to B4XPages. Also - will it work with Android 13?
1. In B4XPages the app will not be paused and nothing special is needed. It is true that the OS can kill the process but it will not happen immediately.
2. In non-B4XPages the recommended way is to make the request from the starter service. The reason that I suggest switching to B4XPages is that it makes such things (as well as many others) much much simpler.