Oct 4 | 8:55 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
midas | has entered the room |
Oct 4 | 9:00 AM |
Mark M. |
hello, midas!
|
Mark M. |
how can I help you today?
|
midas |
Hey mark
|
midas |
I was wondering if you know of a reliable way to check if device is connected to a wifi network with internet access
|
midas |
NetworkInfo was not reliable
|
midas |
lots of false positives
|
Mark M. |
false positives on the wifi network question or the Internet access question?
|
midas |
Internet access
|
midas |
my app connects to a wifi enabled device
|
Mark M. |
I'd make a benign request of some server of interest (e.g., HEAD of /robots.txt)
|
midas |
yeah, thats what I did, not super happy with it
|
Mark M. |
IMHO, in most cases, it doesn't matter whether you can get to the Internet -- it matters whether you can get to your server
|
midas |
agreed
|
midas |
alrighty thanks anyway, I guess Ill stay on in case you think of another approach
|
Mark M. |
AFAIK, all Google is doing for their "do we have Internet access" stuff at the OS level is hitting one of their own servers
|
Mark M. |
to be honest, I'm not certain that there *is* another approach, almost by definition
|
midas |
hmmm
|
midas |
thats interesting
|
Mark M. |
for example, suppose the device is on WiFi, but it is behind a firewall that prevents access to any Web site that has a vowel in its domain name -- is the device on the Internet or not?
|
Oct 4 | 9:05 AM |
midas |
your saying that andoid sdk returns false
|
midas |
cause it checks google.com
|
Mark M. |
I wasn't referring to the SDK necessarily -- I was more thinking of the WiFi icon in the status bar that has the ! if we are connected but might not have Internet access
|
midas |
gotcha
|
Mark M. |
AFAIK, the definition of "Internet access" for the purposes of the ! is whether they can hit one of their own servers
|
midas |
what about when selecting a wifi network. the system shows a list of wifi networks, if any dont have internet capability they are displayed differently
|
Mark M. |
as people, we talk about "whether we have Internet access", but in reality, there are a billion shades of gray between "no connectivity" and "complete unfettered access"
|
Mark M. |
um, I haven't seen that
|
midas |
really?
|
Mark M. |
I just fired up the Settings app on a Pixel running 9.0, and while I get lock icons for whether the AP is password-protected, I do not see any indicators of whether any given AP has Internet access
|
Mark M. |
it shouldn't be possible to know whether it has Internet access without connecting to it
|
Mark M. |
now, all of the APs near me are secured, so I can't rule out that they have Internet-access indicators for unsecured APs
|
Mark M. |
but that would be seriously creepy, if they connected to a random unsecured AP just to test for Internet access
|
Oct 4 | 9:10 AM |
midas |
if thats the only way it is what it is
|
midas |
thanks again
|
Mark M. |
you're welcome, and sorry I didn't have a better solution for you!
|
midas |
at least I know that I have the optimal solution in place!
|
Oct 4 | 10:00 AM |
midas | has left the room |
Mark M. | turned off guest access |