Android background services (like Viber) -
I am developing a small VoIP application and I need to stay connected to the server.
A push notification is used first (to wake the device on incoming calls), but Android push notifications are not reliable due to very long heartbeat intervals.
The second solution was that start startground ()
. This method works, but leaves an icon in the notification bar (I know it should be, but please read).
If I startForeground ()
then sleeps as soon as T phone.
TLDR: There is no background service without Viber
I think they hold a permanent TCP connection and AlarmManager
To take the phone with the interval (let's say 5 minutes) and keep the connection alive.
Check.
Comments
Post a Comment