0

I'm trying to work on an automatic internet activity check. However, I didn't find a result. I'm also not sure whetever I should create a background task or not for this.

Basically what I want sounds very simple. I would like the app to notify the user immediately whenever he lost his internet connection. But how would I do this? I've been searching for over two hours now without a result. I did find functions how to look for an internet connection manually.

I hope anyone is able to help me out!

Thanks

Stefan R
  • 404
  • 2
  • 8
  • 30
  • 2
    http://stackoverflow.com/questions/2384167/check-if-internet-connection-exists-with-javascript – epascarello Jul 25 '13 at 19:05
  • @epascarello I already read that question and it unfortunately did not answer my question. I would like the user to be notified immediately, automatically, as soon as the user loses his connection. – Stefan R Jul 25 '13 at 20:01
  • So you poll it, Do you not know about setTimeout/setInterval? – epascarello Jul 25 '13 at 20:44
  • @epascarello I do, hoever I thought the use of timers could be avoided. I' m not sure what it is like in javascript, however in Game Development I learned you should use as less timers as possible. – Stefan R Jul 25 '13 at 22:26
  • Well that is your only option here, there are no events that fire when the internet connection is dropped, you have to poll to check it. – epascarello Jul 26 '13 at 13:34

0 Answers0