Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Android make polling Service

I already have app, that makes http requests using Retrofit library to the server on PHP. Now my goal is to make some code work in my android app when server mysql database have some changes. I have no idea how to realise it, i already have read a lot information but i cant understand what should i use polling, websocket, FCM.

So, my questions are :

  1. What is the best way to send data from PHP server to android app when Mysql database updates.

  2. If i should use polling, how should i loop my request every 30 seconds?

  3. Is it possible to make polling requests from Service, or it is a bad idea?

Comments