You can call setConnectTimeout() before making the connection. If there is no internet connection, the response code should be -1. (Note that the default timeout is 0, which means that your connection will wait forever for a response.)
Ted Hopp On Mar 30, 7:17 am, aTai <[EMAIL PROTECTED]> wrote: > How do I check whether the phone/emulator is connected to the > internet? > > I'm trying to connect with a server, and I need to figure out how to > detect whether I have connectivity. Is there any way to do this on > android? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] Announcing the new M5 SDK! http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---