Save Response To Server When Network Connection Goes Off
I have two apps Client App and Server App in android What i want To check in my server app that weather client app has internet connection or not. What i have done I had re
Solution 1:
leave this onDisconnect(), write an API that will do nothing but will just ping the server after a fixed time continuously, let's say after each 2 seconds the API will be called(through service), so in case the net is disconnected or the cell phone is even off, since API will not respond to the server, here you will write a code in case app did't ping to the server after 2 seconds(or you can say after 5 seconds), the response(online status) should be FALSE automatically!
so in case the app is again connected to internet, since the service is running so service will update your false into TRUE again that's too simple!
i think this is your required function!
Post a Comment for "Save Response To Server When Network Connection Goes Off"