Android Question background app strategy, Android 6...9+

peacemaker

Expert
Licensed User
Longtime User
Hi, All

So, what is the creation strategy now for the app-client, that must be always running, like a messenger ?
I mean the app that must not be killed by modern Android versions, if app needs periodically to request a server for some updates.
If to develop in the latest B4A 8.5 (and planned to use B4I also, no services here, i remember theoretically yet).

Using StartServiceAtExact for periodical background work with HTTP (during sleep also needed)?
 

DonManfred

Expert
Licensed User
Longtime User
that must be always running, like a messenger
Whatsapp, for example, does not run all the time. It is using Firebasemessaging to get informed about a new Message.
if app needs periodically to request a server for some updates
Create a Service (do NOT use Starter service for this). Do the job there. After you finish work, reshedule the service to start in 30 minutes or more (StartServiceAt). Stop Service and set automaticforeground off.
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
OK, but if really it needs more often, 5...15 mins ?
 
Upvote 0
Top