After a sync has been completed we call a method that processes the synced data. On Android this is causing a ANR (android not reponding) to be displayed when there has been a large amount of data synced. I think this is because the processing is done in the same thread as the UI, as the ANR message is shown if the app can't respond to user input.
I've tried using Rho::timer.start this didn't work and using ruby threads crashes the app.
Is there any suggestion for running long running tasks in the background while keeping the app responsive.
Before processing 'synced data' in local, make a request to local file (e.g public/test.json) with sample content. On success callback process the data. This will be treat as asynchronous process. UI will be freed.