with one comment
If you need to check to see if the Android device is connected to the internet, an alternative (and simple but limited) way to using the ConnectivityManager class can be calling the isReachable method. Here is a sample function:
Written by Mustafa Basgun
October 11, 2010 at 11:23 AM
Posted in Android, Mobile Development, Mobile Experiences
Tagged with android development, connectivitymanager, isreachable
Subscribe to comments with RSS.
The problem with that is those nasty WiFi networks that redirect all your web access to a login web page. This code will resolve http://www.google.com to the IP of their login server (like 220.127.116.11) and will falsely claim that you are connected. It is much safer to double-check by downloading the http://www.google.com page and checking if it contains some static string (that does not change with locale or their daily upgrades).
January 20, 2011 at 12:09 PM
Fill in your details below or click an icon to log in:
You are commenting using your WordPress.com account. ( Log Out / Change )
You are commenting using your Twitter account. ( Log Out / Change )
You are commenting using your Facebook account. ( Log Out / Change )
You are commenting using your Google+ account. ( Log Out / Change )
Connecting to %s
Notify me of new comments via email.
Create a free website or blog at WordPress.com.