On Sat, Aug 21, 2010 at 1:33 AM, tarek attia <[email protected]>wrote:
> > > On Sat, Aug 21, 2010 at 1:43 AM, Miguel Morales > <[email protected]>wrote: > >> Did you not read my reply? Try pinging an ip that's always up like >> 4.2.2.2 or similar. >> So you'll need a few levels of checks, first the normal check you're >> doing now. And then an internet reachability test to test if you can >> reach the internet. >> >> Thank you very much :) .I did it as you suggested.This is what worked for > me :- > > try { > address = InetAddress.getByName("www.google.com"); > > * checkConnection = address.isReachable(60000);* > > this method always returns false in android due to Linux privileges and > something like this.So you can use HTTP timeout instead to check the > Internet connection. > > } > > catch (UnknownHostException e) > { > guiHandler.post(noConnectionAlert); > } > catch (IOException e) > { > guiHandler.post(noConnectionAlert); > } > > >> This isn't a bug in android, or some sort of error. This is a common >> functionality in all software. If you're connected to your router, >> but your router isn't connected to the internet. All the software >> will think it's connected to the internet and try to connect forever. >> >> (At least for software that doesn't run the check I've told you) >> >> >> On Fri, Aug 20, 2010 at 3:38 PM, tarek attia <[email protected]> >> wrote: >> > >> > >> > On Sat, Aug 21, 2010 at 12:43 AM, Mark Murphy <[email protected]> >> > wrote: >> >> >> >> On Fri, Aug 20, 2010 at 4:50 PM, tarek attia <[email protected]> >> >> wrote: >> >> > Any Idea??? >> >> >> >> One idea is for you to have patience and not expect immediate >> >> responses to your emails. >> > >> > Sorry for this,but I have been with this error long time . >> > >> >> >> >> >> >> >> >> You can try requestRouteToHost(), but I've seen some reports to >> >> suggest that it does not work very well. >> >> >> >> The best option is for you to simply try some operation on whatever >> >> server you are trying to reach. For example, download a small graphic >> >> from the Web site if you are trying to access that site's Web service. >> >> >> > What if this server is down at this time!!! I want to show the reason >> of >> > the disability either the no internet connection or the server is down >> ?? >> >> >> >> -- >> >> Mark Murphy (a Commons Guy) >> >> http://commonsware.com | http://github.com/commonsguy >> >> http://commonsware.com/blog | http://twitter.com/commonsguy >> >> >> >> _The Busy Coder's Guide to Android Development_ Version 3.1 Available! >> >> >> >> -- >> >> You received this message because you are subscribed to the Google >> >> Groups "Android Developers" group. >> >> To post to this group, send email to >> [email protected] >> >> To unsubscribe from this group, send email to >> >> [email protected]<android-developers%[email protected]> >> >> For more options, visit this group at >> >> http://groups.google.com/group/android-developers?hl=en >> > >> > >> > -- >> > tarek >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups "Android Developers" group. >> > To post to this group, send email to >> [email protected] >> > To unsubscribe from this group, send email to >> > [email protected]<android-developers%[email protected]> >> > For more options, visit this group at >> > http://groups.google.com/group/android-developers?hl=en >> >> >> >> -- >> http://developingthedream.blogspot.com/, >> http://diastrofunk.com, >> http://www.youtube.com/user/revoltingx, ~Isaiah 55:8-9 >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Android Developers" group. >> To post to this group, send email to [email protected] >> To unsubscribe from this group, send email to >> [email protected]<android-developers%[email protected]> >> For more options, visit this group at >> http://groups.google.com/group/android-developers?hl=en >> > > > > -- > tarek > -- tarek -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

