Arduino Uno

Header

Corner

Check Internet Access

Use the following method:

 
public boolean isOnline() {
    ConnectivityManager cm =
        (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
    NetworkInfo netInfo = cm.getActiveNetworkInfo();
    return netInfo != null && netInfo.isConnectedOrConnecting();
}

Also add the following permission to the AndroidManifest.xml:

 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

 Source