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 () but it still works if the phone is sleeping and accepts incoming calls (even here That with push notice disabled) how do they do this?

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

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -