For my android app I'm looking for an elegant way of detecting client connectivity status. The server needs to know if client is online or offline.
I've read this answer,
... Server should send ping after some time interval to the device and device should reply. If device is not replying this means user is offline ...
but I feel constant pinging is lame and quite heavy on resources both client and server side. Is there a more elegant, preferably event driven, approach to detect if a client is offline?
While my situation applies to Android and a Google App Engine in java, I plan on extending to web and ios clients so a platform in depended solution is preferred.
Update: The same answer also mentions socket connections:
...Basically you need to create socket connection with server and exchange ping
To my knowledge, having an always on socket connection with the server is good for multi player gaming, but is it suitable for an always on, but only occasionally sending/receiving data like service?