C
C
coden552016-04-18 17:32:29
Android
coden55, 2016-04-18 17:32:29

Using WebSocket in an Android Application?

Is it recommended to use a websocket in a service to maintain a persistent connection? What are the pitfalls? How does this affect battery life? How is event notification implemented in applications such as VKontakte, for example? Is it permissible to use websocket as an alternative to Google Cloud Message, and in what cases?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kanesy, 2016-04-19
@kanesy

1. A persistent connection is most conveniently implemented on sockets.
2. Pitfalls - reconnect and session recovery. It is necessary to receive the data that was transferred during the disconnect.
5. I can assume that GCM still works asynchronously, and the socket is needed for a permanent connection (for example, for chats or online games)

M
Max, 2016-05-12
@mbelskiy

These tools should not be separated, they should be used together. On sockets, everything works while the user is inside the application / chat screen, on notifications when the application is in the background

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question