S
S
Sarrius2016-04-13 14:22:32
Android
Sarrius, 2016-04-13 14:22:32

How to speed up the process of connecting to the server through HttpUrlConnection?

I have a class in which I establish a connection with the server before each request (httpUrlConnection.openConnection(URL)) : each request has its own URL, so there is a connection delay before each request and in general this process takes too much time compared to the Web . And one more thing: you have to hardcode for each request (zero and redefine HttpUrlConnection, URL, headers, etc.). I don’t even fit in my head how to make 1 class with a method on POST and a method on GET requests.
Who has ideas how to organize the class correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Gamega, 2016-04-13
@gadfi

What can you advise in my case?

retrofit + dagger

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question