Good afternoon, ladies and gentlemen. Can you please tell an inexperienced person to implement Http requests using Retrofit2 in a separate thread? Opinions on the Internet diverge and where it is generally not discussed. I saw the information that Retrofit2 just allows the design of the application without a separate stream for requests, is it? The application is a simple requests are all made at the initiative of the user. Thank.

    2 answers 2

    Retrofit independently displays everything in another thread. But for answers it is better to use AsyncTask.

    Modern option - work through Rx (jet stream). Here is a good material on your topic https://habrahabr.ru/post/305478/

      Retrofit allows you to execute queries both synchronously and asynchronously.

      Asynchronous requests are executed in separate (other than UI-thread) threads.

      Read more: Retrofit - Synchronous and Asynchronous Requests .