Is your application perhaps missing the “android.permission.INTERNET” permission in the manifest? Unity should autodetect any usage of networking component but perhaps it fails for some reason…
You can inspect the permissions assigned to the application by looking under Settings > Application > Manage applications, on your device.
instead of using the WWW class I use System.Net and HttpWebRequest
this way you can check for more than just web availability. You get 3 levels of connection checking:
No connection
Redirected (this was important for me because if you are connecting to the internet at a college or hotel, they need you to sign in before using the internet which means you’ll get a positive ping / check but you really don’t have internet yet because you can’t send anything to the site you actually want)
(Adding a comment to an old posting in case somebody finds this using search…)
I have made an easy asset called Internet Reachability Verifier for Unity, which implements a technique called “captive portal detection”, but still does it only using the built-in WWW class.
Using it you will know if internet is truly reachable or if you’re just hitting e.g. a login page, like mentioned at the point (2) above.
first thing is that Android device still have 127.0.0.0 when there isn’t connection, so if you try to ping.isDone it return a true value.
but what about ping.time ? if you are not connected it return a fixed value of 1