How to check internet connection in android programmatically
Answer 1. Whenever we need connectivity in an app, it is a good practice to check that we have it available before requesting any operation and wait for a timeout or similar error. For this you have to use ConnectivityManager and NetworkInfo , I always use the following snippet: 1. private boolean isNetworkConnected(Context context) { …
How to check internet connection in android programmatically Read More »