1
I develop an application in Cordova, which synchronizes with an online database, the synchronization part is all in Java. (Context of the app)
I am developing a "Log" screen for the synchronization of which will be shown to the user how many records were successfully synchronized, how many with error and the respective errors.
Through researches I have come to the conclusion that I should use a Thread to be "listening" to synchronization.
The question is as follows: I have seen in the documentation that Asynctask should be used for tasks of the order of a few seconds of execution and for longer tasks use Executor, Threadpoolexecutor and Futuretask. Synchronization usually takes up to hours at first sync. Should I actually use the second option? If someone has a good tutorial that shows me how to do it because what I already researched I can not apply to my problem.
Why Asynctask cannot be used for time-consuming tasks?