Hello All,

Does sync work in the background? or it work only while application is open?

Thanks

Prajakta Roshankhede

Hi Prajakta,

When the application is active, sync runs as a background (async) task, so the application is still responsive to user actions.

You can also run the sync on the foreground, than the user has no interaction until the sync is done.

When the application is not running,  either suspended or not started at all, then no sync takes place.

Regards,

Daniel

Hi Prajakta,

Its not work when application is not running. For more information you can refer this post.

Thanks

Vikas Sharma wrote:

Hi Prajakta,

Its not work when application is not running. For more information you can refer this post.

Thanks

Thanks for sharing that post. It has the solution from me :)


Daniël Kuhlmann wrote:

Vikas Sharma wrote:

Hi Prajakta,

Its not work when application is not running. For more information you can refer this post.

Thanks

Thanks for sharing that post. It has the solution from me :)


Yes Daniel, answered by you. I was giving reply before that you post answer.

Vikas Sharma wrote:

Hi Prajakta,

Its not work when application is not running. For more information you can refer this post.

Thanks

Is there any way to that?



Daniël Kuhlmann wrote:

Hi Prajakta,

When the application is active, sync runs as a background (async) task, so the application is still responsive to user actions.

You can also run the sync on the foreground, than the user has no interaction until the sync is done.

When the application is not running,  either suspended or not started at all, then no sync takes place.

Regards,

Daniel

Hello Denial,

Is it possible to sync data even if the application is not running?

I want to sync data every after 15 min (like timer). 

And if we do so what will be the impact on overall application and even on the phone performance?

Solution

Hi Prajakta,

As already mentioned, syncing will only work when the application is active on the foreground.

If it is active then you can implement sync at different moments (like login, onrequest, ononline, etc.)

You can also implement a JavaScript timer to start it every 15 minutes if that is what you want.

The performance impact depends on a few factors, most important:

  1. the frequency, the more often the more impact. You would have to figure out the frequency that data can change and set a proper timeout for it. If data changes every 20 minutes on average, there is not lot to gain in syncing every 5 minutes.
  2. sync algorithm. The "smarter" the sync in only syncing changes and not full data sets will have a positive impact on performance.
  3. The amount of data being synced. The less data the faster the sync (this is of course also related to the previous point.

Regards,

Daniel

Solution

Hi Prajakta,

Actually its not possible at least in Outsystems to sync in background when application is not running. What is your use case, as if application is not running so there will be no data to upload on server and if you want to download something then can download on application start.

So please explain what is your use case.

Thanks.


Daniël Kuhlmann wrote:

Hi Prajakta,

As already mentioned, syncing will only work when the application is active on the foreground.

If it is active then you can implement sync at different moments (like login, onrequest, ononline, etc.)

You can also implement a JavaScript timer to start it every 15 minutes if that is what you want.

The performance impact depends on a few factors, most important:

  1. the frequency, the more often the more impact. You would have to figure out the frequency that data can change and set a proper timeout for it. If data changes every 20 minutes on average, there is not lot to gain in syncing every 5 minutes.
  2. sync algorithm. The "smarter" the sync in only syncing changes and not full data sets will have a positive impact on performance.
  3. The amount of data being synced. The less data the faster the sync (this is of course also related to the previous point.

Regards,

Daniel

Thanks Daniel, All the three points are implemented already. 

I was only concerned about syncing of data while application is closed. Now I am clear.

Thanks


Daniël Kuhlmann wrote:

Hi Prajakta,

As already mentioned, syncing will only work when the application is active on the foreground.

If it is active then you can implement sync at different moments (like login, onrequest, ononline, etc.)

You can also implement a JavaScript timer to start it every 15 minutes if that is what you want.

The performance impact depends on a few factors, most important:

  1. the frequency, the more often the more impact. You would have to figure out the frequency that data can change and set a proper timeout for it. If data changes every 20 minutes on average, there is not lot to gain in syncing every 5 minutes.
  2. sync algorithm. The "smarter" the sync in only syncing changes and not full data sets will have a positive impact on performance.
  3. The amount of data being synced. The less data the faster the sync (this is of course also related to the previous point.

Regards,

Daniel

Hi Daniel,

I am trying to do the same. Where is the best place to put the js timer so it can run every hour?