// Path: Networking/app/src/main/java/qa/edu/qu/cse/cmps312/networking/Consts/Consts.java
// public class Consts {
//     // Get your user name at http://www.geonames.org/login
//     public static final String USERNAME = "insert_username";
//     public static final String URL = "http://api.geonames.org/earthquakesJSON?north=44.1&south=-9.9&east=-22.4&west=55.2&username=";
//     public static final String URLXML = "http://api.geonames.org/earthquakes?north=44.1&south=-9.9&east=-22.4&west=55.2&username=";
// }


import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import qa.edu.qu.cse.cmps312.networking.Consts.Consts;
            String data = "";
            HttpURLConnection httpUrlConnection = null;

            try {
                //This is using my username and password
                httpUrlConnection = (HttpURLConnection) new URL(Consts.URL + Consts.USERNAME)
                        .openConnection();

                InputStream in = new BufferedInputStream(
                        httpUrlConnection.getInputStream());

                data = readStream(in);

            } catch (MalformedURLException exception) {
                Log.e(TAG, "MalformedURLException");
            } catch (IOException exception) {
                Log.e(TAG, "IOException");
            } finally {
                if (null != httpUrlConnection)
                    httpUrlConnection.disconnect();
            }
            return data;
        }

        @Override
        protected void onPostExecute(String result) {
            mTextView.setText(result);
        }

        private String readStream(InputStream in) {
// Path: Networking/app/src/main/java/qa/edu/qu/cse/cmps312/networking/Consts/Consts.java
// public class Consts {
//     // Get your user name at http://www.geonames.org/login
//     public static final String USERNAME = "insert_username";
//     public static final String URL = "http://api.geonames.org/earthquakesJSON?north=44.1&south=-9.9&east=-22.4&west=55.2&username=";
//     public static final String URLXML = "http://api.geonames.org/earthquakes?north=44.1&south=-9.9&east=-22.4&west=55.2&username=";
// }


// Path: Networking/app/src/main/java/qa/edu/qu/cse/cmps312/networking/NetworkingURLActivity.java
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import qa.edu.qu.cse.cmps312.networking.Consts.Consts;

            String data = "";
            HttpURLConnection httpUrlConnection = null;

            try {
                //This is using my username and password
                httpUrlConnection = (HttpURLConnection) new URL(Consts.URL + Consts.USERNAME)
                        .openConnection();

                InputStream in = new BufferedInputStream(
                        httpUrlConnection.getInputStream());

                data = readStream(in);

            } catch (MalformedURLException exception) {
                Log.e(TAG, "MalformedURLException");
            } catch (IOException exception) {
                Log.e(TAG, "IOException");
            } finally {
                if (null != httpUrlConnection)
                    httpUrlConnection.disconnect();
            }
            return data;
        }

        @Override
        protected void onPostExecute(String result) {
            mTextView.setText(result);
        }

        private String readStream(InputStream in) {
            BufferedReader reader = null;