Timur Panzhiev
Timur Panzhiev

Reputation: 760

Handling multiple TCP and HTTP responses in SplashActivity

I should organize 2 HTTP (Retrofit + Rx) and 2 TCP (KryoNet) requests in my SplashActivity. When I get the response from all requests I should start MainActivity. How can I combine requests, handle responses and after that start MainActivity? Help me please, dear developers.

I currently work with Electrum Protocol (https://github.com/kyuupichan/electrumx/blob/master/docs/PROTOCOL.rst)

And it will be an amazing event if you can give an advice how to organize correct tcp request.

Upvotes: 0

Views: 54

Answers (1)

Klevin Delimeta
Klevin Delimeta

Reputation: 168

It is a bad practice to use splash screens to make user wait for the response. Moreover this is a tcp request, which means there might be a big file which will make user angry to wait for 3 minutes just for file to download.

The best way to handle these requests and especially when they are needed on app start, is to use asynchronous requests. And after response arrives you do something with it.

Best

Upvotes: 0

Related Questions