I've created a system that is a web application in which Android devices enrol. It is an EMM system (Enterprise mobility management). I would like to create some sort of heart beat service that calls a web service proving the device is still online and connected to the network. This can then be shown as a green blob on the web application.
I do have a concern.
1) If the system has say 100000 devices enrolled and the heart beat service fires every 5 minutes, would this have an detrimental impact on the server?
i was thinking of creating a BG service that fires the web call and using START_STICKY in case Android kills the service... not sure if that is deprecated now thinking about it.
I could also creat a push notification to restart this service in case the web application has not heard from the device for a while. This is obviously subject to the device not being in Doze.
Does anybody have experience or know best practices for creating a heart beat service or any potential drawbacks i should think about?
i'm not asking for code, more how someone has done it or the best way to do it.
thanks
[EDIT1] I have found the following link. could this be used to contact the server. i understand fcm has a persistent connection.