Calm down! I don't say that my practice is the best one on Earth. That would be stupid. We all do what we think is the best for our job. I just try to make things clear and your reasons are not. I can't see why you need to reach a DNS. If you have a japanese customer that cannot access to your DNS for an unknown reason but have a perfect access to the server used by your app, what's your conclusion? What your app will do? I really don't understand. Microsoft doesn't do it, Google doesn't do it, Facebook doesn't do it, so if I had to answer with the same agressive tone that you use, I would ask: why do you think you're smarter than them? And you probably noticed that I did not talk of the diagnosis tools that these companies may provide because, of course, the main goal of these tools is to provide clues about what's going wrong. I talked of the connected apps of these companies, like your Play Store or your Internet Browser. If we cannot discuss and exchange ideas, if you cannot explain in simple words what's the advantage of your solution, then we should stop now. I don't like to be taken for a stupid guy.
Well, that makes two of us.
And I do not imply that you are stupid, i know you are not. I just trying to explain the scenarios where testing the connection status kan be good practice.
They shall ofcourse not access my DNS, they need to have a DNS availble for the name translation. As the other guy pointed out, it's good to know if you have a basic connection availible before you try to connect something with HTTP or other protocols, because they have a timeouts and that can be very frustrating for customers to get cryptic error messages from these protocols. That's all.
And personally i like to say to a customer to run this test that i have availible easy in a menu so I can know if there is a more serious issue than the usual router crash or hang that is the problem 99% of the times before I send someone to check the hardware.
My tests are and this is not only adressed to you Informatix, I know you already know this but more to explain why I have the functionallity we are discussing here.
First I check if the WIFI or mobile connection is actually on, and turn them on if they are not.
There is a few Android battery saving functions that turn of these of save power without any info to the user, so when they come back from Pause all of the sudden the WIFI or the mobile is off. I tell the customers to charge if the battery is low.
Checking if connected
Then I check if the WIFI or mobile connection is connected. If not I ask them to move if they are on mobile connection.
Then I check the ping to our gateway
The reason for this is that some mobile and other routers goes into power saving mode and close the connection if they are inactive to long. So if that fails wait 5 seconds and send it again, usually the router takes a few seconds to wake up and connect again. I here show a toast message to inform the user that connection is temporary down, trying again in 5 4 3 2 1 seconds.
If this keeps failing 6 times i ask the customer to restart the router.
If that fails even if the router is restarted i do the DNS check, because you can have a connection to the WIFI router without actually be abel to connect to the internet.
I ask them to check the WIFI so it's not moved to a unprefered open connection in the neighbourhood. (That happens sometimes). Then I ask them to "forget" that WIFI-network and connect to the right network.
If that is not working I ask the customer to check if any cables is disconnected. Then I ask the customer to please call the ISP and see if they have any problems.
When all this is checked, i put up the number to us, because then the 99.99% of the external error sources are eliminated, then we can start checking if there is any errors or service crashes on our side. One time in about 2 year that has happend, the software on our side had crashed and I had forgot to check the restart at crash in the server.
Thats how we do, and it works for us. Of course it might be better ways to do it, but the persons on the other side is not tech wizards, and they need simple instructions to eliminate the most common errors.
I hope you understand my reasoning here, and if you see anything I can do better i'm open to suggestions.