Can Can Square Tape file backup be used from main stream in android?

The square has the name of the open source project Tape http://square.imtqy.com/tape/ , which implements a permanent backup of the file. All examples show that objects can be added to the queue from the main thread. However, any other best practice for android seems to indicate that doing I / O on the main thread is just a chicken game with ANR.

Is a Square Tape file backup intended for use from the main stream supported? If so, what makes it reliably safe for use from the main thread without fear of ANR and any other form of I / O?

+4
source share
1 answer

If you look at http://square.imtqy.com/tape/ in the examples , basically you should use the service in the stream for each inherited Task class to do this work, because the task has a concept of what can be done.

If you want, you can do some research using HandlerThread, AsyncTask or even Executors and check which one is best for your needs.

+1
source

Source: https://habr.com/ru/post/1525295/


All Articles