0

In my website users can send real-time messages. So, I want to send those messages to my Android application in real-time. After a search I did on the internet, I think the methods to do that are 2, websockets and long polling. I am using WordPress for the website but I am new on websockets and long polling methods because I used to use JSON APIs, that's why I need some help on something. I am trying to figure out what should I do in order to have those messages in real time to my Android application, so I tried to use long polling as it is used to the "big" websites like Facebook and Twitter. Until now, anything other inside the application is created using JSON API and Retrofit library, but I couldn't find any way to add real time updates with that method. The problem I am facing is how can I connect my website to my application using long polling? Any answer will be appreciated!

Mark Rotteveel
  • 90,369
  • 161
  • 124
  • 175
Rider25
  • 19
  • 6
  • I'd personally recommend looking into a service such as [Pusher](https://pusher.com/). It is free for light traffic (200k messages per day with 100 connections) and relatively easy to implement in many different languages and frameworks. You'll also want to consider how many "clients" will be connected to this, do they need message history, room, etc. – Chris Haas Jan 05 '22 at 17:41

0 Answers0