Build Real-Time Android Apps with WebSockets and Kotlin
Before we get started on WebSocket integration, it’s worth quickly explaining how building real-time mobile apps used to work – and why issues with lag and latency led engineers to turn to WebSockets instead. Engineers building real-time Android apps struggled to make sure updates were reflected immediately when a user sent them. To solve this, they tried polling, which meant firing off a GET request to the server, say every five seconds, to a /messages endpoint.