WebSocket is a great way to stay up to date with a server for real-time apps like trading clients or chats.
In Android the general way to handle network requests is to use Retrofit and OkHttp libraries. This solution offers great debugging functionality by providing the interceptor mechanism that can be used to log requests in LogCat or to connect with more advanced debug tools like
Flipper.
On the socket side there is the
Scarlet library from Tinder that offers a Retrofit like interface to deal with socket connections. It has similar interfaces for requests and a similar builder that accepts
OkHttpClient instances.
Scarlet library is very useful when working with sockets but it has one disadvantage: there is no logging mechanism for socket messages. Although you can add an OkHttp interceptor when building a Scarlet instance, that interceptor won't intercept socket messages. As we can see in the following issues
[1][2] the problem still exists.