@@ -0,0 +1,1536 @@
+package com.beepscore.android.sunshine;%0A%0Aimport android.app.Activity;%0Aimport android.content.Context;%0Aimport android.content.Intent;%0Aimport android.net.ConnectivityManager;%0Aimport android.net.Network;%0Aimport android.net.NetworkInfo;%0A%0A/**%0A * Created by stevebaker on 10/25/15.%0A */%0Apublic class NetworkUtils %7B%0A%0A    /**%0A     *%0A     * @return true if network has connectivity (i.e. is reachable), else return false%0A     */%0A    boolean hasConnectivity(Context context) %7B%0A%0A        // http://developer.android.com/reference/android/net/ConnectivityManager.html%0A        ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);%0A%0A        // I tried using EXTRA_NO_CONNECTIVITY but didn't get it to work%0A        // boolean noConnectivityExtra = activity.getIntent().getBooleanExtra(ConnectivityManager.EXTRA_NO_CONNECTIVITY, false);%0A%0A        // http://stackoverflow.com/questions/11062840/best-way-to-check-for-internet-connection-in-android?rq=1%0A        if (connectivityManager != null) %7B%0A            Network%5B%5D networks = connectivityManager.getAllNetworks();%0A            if ((networks != null)%0A                    && (networks.length %3E 0)) %7B%0A                for (Network network : networks) %7B%0A                    NetworkInfo info = connectivityManager.getNetworkInfo(network);%0A                    if (info.getState() == NetworkInfo.State.CONNECTED) %7B%0A                        return true;%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A        return false;%0A    %7D%0A%7D%0A

Add class NetworkUtils with method hasConnectivity.