Receiving message from server instantly while android screen is locked/is in a sleep

36 Views Asked by At

I want to write a 'service' app that will be connected to a server, the server will send messages to the app and the phone will popup a notification to the screen instantly upon receiving the message from the server even if the phone is locked. (like Whatsapp/Telegram etc..)

Push Notifications are not instant enough.

I was thinking about using WebSocket for that, but not sure it is the best approach. What is the best approach?

Sample code will be appriciated!

Thanks.

0

There are 0 best solutions below