@@ -0,0 +1,1063 @@
+package ca.ualberta.team7project.network;%0A%0Aimport android.content.Context;%0Aimport android.net.ConnectivityManager;%0Aimport android.net.NetworkInfo;%0A%0A/**%0A * reference http://www.androidhive.info/2012/07/android-detect-internet-connection-status/%0A * Helper class to check if there is network connection%0A * @author wzhong3%0A *%0A */%0Apublic class ConnectionDetector %7B%0A%09private Context context;%0A    %0A    public ConnectionDetector(Context context)%7B%0A        this.context = context;%0A    %7D%0A %0A    public boolean isConnectingToInternet()%7B%0A        ConnectivityManager connectivity = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);%0A          if (connectivity != null) %0A          %7B%0A              NetworkInfo%5B%5D info = connectivity.getAllNetworkInfo();%0A              if (info != null) %0A                  for (int i = 0; i %3C info.length; i++) %0A                      if (info%5Bi%5D.getState() == NetworkInfo.State.CONNECTED)%0A                      %7B%0A                          return true;%0A                      %7D%0A %0A          %7D%0A          return false;%0A    %7D%0A%7D%0A

add new class to check the network connection