Volley or ASyncTaskLoader

They say all over the place that we should use ASyncTaskLoaders because they don't block the user interface thread very well. And now there is a Will.

I think we will not be able to use both of them, because Volley does it on his own. What do you think? Which one is better?

+6
source share
4 answers

These 2 technologies are different and hardly comparable. They have different goals and can also work together. For example, you can use a Loader, which uses Volley to load data and inherits it directly from Loader (not AsyncTaskLoader, because Volley also handles streams).

The main advantages of using loaders:

  • The life cycle synchronizes with the Activity / Fragment life cycle automatically
  • Data status and load are not lost when configuration changes
  • The boot monitor tracks changes and automatically provides new results to the client’s fragment / activity.

Key benefits of using Volley:

  • High Performance Network Stack
  • Automatic disk cache that respects the HTTP server policy
  • Powerful cancellation mechanism.

You can combine both to get both sets of benefits, or you can use Volley without bootloaders with its simple API.

+3
source

I have been using Volley for a month and I must say that I am very satisfied. This really helps to not really worry about the details of the streaming implementation. So far, both shared network and remote image downloads have worked.

This is not that there are no problems, but so far they are minimal.

+2
source

Better ask how this volleyball vs Async vs RxJava

You can use this RXJava for a background thread, but for better call efficiency of quiet services. Volleyball is highly recommended, and coding is also less required compared to asynchronous task loaders!

+1
source

Below is information on current methods of working with Android. It discusses the use of Volley and RXJava : https://github.com/futurice/android-best-practices

+1
source

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


All Articles