I want a rest call to happen in android if the app is killed by OS or removed from recent app list -


i have add following feature in android application.

there client, when client logs application, clicks button make available user going online. when clicks button rest call made, , change db status(status changed online) , make him online.

now problem want make client unavailable(offline) if app getting forced close or removed android background due low memory or removed user recent app. if of these situations occur rest call handle situation.

in normal scenario if online can click button again make rest call change status unavailable(offline) in db.

note: don't want use onpause() or onstop() method because want client online if navigates out of application , comes back.

in principle can't because there's case when user can disconnected without feedback (e.g. losing signal, battery).

imo should ways detect timeout server side, similar socket.io disconnect() outlined in this answer.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -