I want to check whether an active internet connection exists or not. For that I found out I can do that with the isReachable() method from the InetAddress class. Unfortunately (as the JavaDoc suggests and this post verifies), this only works with root privilegies, what is no solution to my problem.
When I run the following code, isReachable is always false:
InetAddress address = InetAddress.getByName("173.194.35.3"); //e.g. google
boolean isReachable = address.isReachable(2000); //ms
Therefore, I am searching for a good alternative to check for an active internet connection without the necessity of root privilegies.
Thank you!