PDA

View Full Version : Plug in event



sudhansu
9th June 2010, 10:59
Hi All
Is there any signal which i can use to know if Network cable is unplugged?

amoswood
9th June 2010, 19:18
Not to my knowledge, there isn't. You would have to setup a simple test class instead that periodically ping some internet site and test for a successful hit.

squidge
9th June 2010, 19:39
Since your app doesn't know where the traffic is going to go the result would be meaningless anyway. You could have the network cable disconnected but internet access via a bluetooth connection to a 3G phone or dongle.

So the easiest way to detect is to just try: If you can't connect to the server, report an error. User will notice if the cable isn't plugged in when they investigate.