mirror of
				https://github.com/bspeice/UNCCGameDay
				synced 2025-11-04 02:10:35 -05:00 
			
		
		
		
	Add template Javadocs. Needs actual documentation yet.
This commit is contained in:
		@ -3,14 +3,28 @@ package com.uncc.gameday;
 | 
			
		||||
import android.app.Application;
 | 
			
		||||
import android.content.Context;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class GameDay.
 | 
			
		||||
 */
 | 
			
		||||
public class GameDay extends Application{
 | 
			
		||||
	
 | 
			
		||||
	/** The context. */
 | 
			
		||||
	private static Context context;
 | 
			
		||||
 | 
			
		||||
    /* (non-Javadoc)
 | 
			
		||||
     * @see android.app.Application#onCreate()
 | 
			
		||||
     */
 | 
			
		||||
    public void onCreate(){
 | 
			
		||||
        super.onCreate();
 | 
			
		||||
        GameDay.context = getApplicationContext();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Gets the app context.
 | 
			
		||||
     *
 | 
			
		||||
     * @return the app context
 | 
			
		||||
     */
 | 
			
		||||
    public static Context getAppContext() {
 | 
			
		||||
    	return GameDay.context;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -7,13 +7,25 @@ import android.widget.Toast;
 | 
			
		||||
 | 
			
		||||
import com.uncc.gameday.R;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class Alerts.
 | 
			
		||||
 */
 | 
			
		||||
public class Alerts extends MenuActivity {
 | 
			
		||||
	
 | 
			
		||||
	/* (non-Javadoc)
 | 
			
		||||
	 * @see com.uncc.gameday.activities.MenuActivity#onCreate(android.os.Bundle)
 | 
			
		||||
	 */
 | 
			
		||||
	protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
		super.onCreate(savedInstanceState);
 | 
			
		||||
		setContentView(R.layout.activity_alerts);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * On click timed alerts.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param view the view
 | 
			
		||||
	 */
 | 
			
		||||
	public void onClickTimedAlerts(View view) {
 | 
			
		||||
		int toastDuration = Toast.LENGTH_SHORT;
 | 
			
		||||
		if (((CheckBox) view).isChecked())
 | 
			
		||||
@ -24,6 +36,11 @@ public class Alerts extends MenuActivity {
 | 
			
		||||
			Toast.makeText(this, "Timed alerts disabled.", toastDuration).show();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * On click organization alerts.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param view the view
 | 
			
		||||
	 */
 | 
			
		||||
	public void onClickOrganizationAlerts(View view) {
 | 
			
		||||
		int toastDuration = Toast.LENGTH_SHORT;
 | 
			
		||||
		if (((CheckBox) view).isChecked())
 | 
			
		||||
@ -34,6 +51,11 @@ public class Alerts extends MenuActivity {
 | 
			
		||||
			Toast.makeText(this, "Organization alerts disabled.", toastDuration).show();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * On click university alerts.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param view the view
 | 
			
		||||
	 */
 | 
			
		||||
	public void onClickUniversityAlerts(View view) {
 | 
			
		||||
		int toastDuration = Toast.LENGTH_SHORT;
 | 
			
		||||
		if (((CheckBox) view).isChecked())
 | 
			
		||||
 | 
			
		||||
@ -12,12 +12,20 @@ import android.os.Bundle;
 | 
			
		||||
import com.uncc.gameday.R;
 | 
			
		||||
import com.uncc.gameday.alerts.AlertService;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class Home.
 | 
			
		||||
 */
 | 
			
		||||
public class Home extends MenuActivity {
 | 
			
		||||
		
 | 
			
		||||
 | 
			
		||||
	
 | 
			
		||||
	/** The alarm rate. */
 | 
			
		||||
	private final long alarmRate = 300000; // 5 Minutes
 | 
			
		||||
	
 | 
			
		||||
	/* (non-Javadoc)
 | 
			
		||||
	 * @see com.uncc.gameday.activities.MenuActivity#onCreate(android.os.Bundle)
 | 
			
		||||
	 */
 | 
			
		||||
	protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
		super.onCreate(savedInstanceState);
 | 
			
		||||
		setContentView(R.layout.activity_home);
 | 
			
		||||
@ -37,6 +45,9 @@ public class Home extends MenuActivity {
 | 
			
		||||
		this.onFirstRun();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * On first run.
 | 
			
		||||
	 */
 | 
			
		||||
	protected void onFirstRun() {
 | 
			
		||||
		SharedPreferences settings = this.getPreferences(MODE_PRIVATE);
 | 
			
		||||
		if (settings.getBoolean("FIRST_RUN", true)) {
 | 
			
		||||
 | 
			
		||||
@ -8,14 +8,24 @@ import android.view.MenuItem;
 | 
			
		||||
 | 
			
		||||
import com.uncc.gameday.R;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class MenuActivity.
 | 
			
		||||
 */
 | 
			
		||||
public class MenuActivity extends Activity {
 | 
			
		||||
 | 
			
		||||
	/* (non-Javadoc)
 | 
			
		||||
	 * @see android.app.Activity#onCreate(android.os.Bundle)
 | 
			
		||||
	 */
 | 
			
		||||
	@Override
 | 
			
		||||
	protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
		super.onCreate(savedInstanceState);
 | 
			
		||||
		setContentView(R.layout.activity_home);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* (non-Javadoc)
 | 
			
		||||
	 * @see android.app.Activity#onCreateOptionsMenu(android.view.Menu)
 | 
			
		||||
	 */
 | 
			
		||||
	@Override
 | 
			
		||||
	public boolean onCreateOptionsMenu(Menu menu) {
 | 
			
		||||
		// Inflate the menu; this adds items to the action bar if it is present.
 | 
			
		||||
@ -23,6 +33,9 @@ public class MenuActivity extends Activity {
 | 
			
		||||
		return true;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/* (non-Javadoc)
 | 
			
		||||
	 * @see android.app.Activity#onOptionsItemSelected(android.view.MenuItem)
 | 
			
		||||
	 */
 | 
			
		||||
	@Override
 | 
			
		||||
    public boolean onOptionsItemSelected(MenuItem item) {
 | 
			
		||||
    	switch (item.getItemId()){
 | 
			
		||||
 | 
			
		||||
@ -9,14 +9,26 @@ import com.uncc.gameday.activities.parking.LotViewFragment;
 | 
			
		||||
import com.uncc.gameday.parking.ParkingChoice;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class Parking.
 | 
			
		||||
 */
 | 
			
		||||
public class Parking extends MenuActivity {
 | 
			
		||||
 | 
			
		||||
	/* (non-Javadoc)
 | 
			
		||||
	 * @see com.uncc.gameday.activities.MenuActivity#onCreate(android.os.Bundle)
 | 
			
		||||
	 */
 | 
			
		||||
	@Override
 | 
			
		||||
	protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
		super.onCreate(savedInstanceState);
 | 
			
		||||
		setContentView(R.layout.activity_parking);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * On radio button click.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param v the v
 | 
			
		||||
	 */
 | 
			
		||||
	public void onRadioButtonClick(View v) {
 | 
			
		||||
		FragmentManager fm = this.getFragmentManager();
 | 
			
		||||
		LotViewFragment f = new LotViewFragment();
 | 
			
		||||
 | 
			
		||||
@ -5,8 +5,15 @@ import android.os.Bundle;
 | 
			
		||||
import com.uncc.gameday.R;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class Registration.
 | 
			
		||||
 */
 | 
			
		||||
public class Registration extends MenuActivity {
 | 
			
		||||
 | 
			
		||||
	/* (non-Javadoc)
 | 
			
		||||
	 * @see com.uncc.gameday.activities.MenuActivity#onCreate(android.os.Bundle)
 | 
			
		||||
	 */
 | 
			
		||||
	@Override
 | 
			
		||||
	protected void onCreate(Bundle savedInstanceState) {
 | 
			
		||||
		super.onCreate(savedInstanceState);
 | 
			
		||||
 | 
			
		||||
@ -17,13 +17,26 @@ import com.uncc.gameday.parking.ParkingCoordinate;
 | 
			
		||||
import com.uncc.gameday.parking.ParkingLot;
 | 
			
		||||
import com.uncc.gameday.parking.RatingChoices;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class LotViewFragment.
 | 
			
		||||
 */
 | 
			
		||||
public class LotViewFragment extends DialogFragment {
 | 
			
		||||
	
 | 
			
		||||
	/** The pc. */
 | 
			
		||||
	ParkingChoice pc;
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Instantiates a new lot view fragment.
 | 
			
		||||
	 */
 | 
			
		||||
	public LotViewFragment(){
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Initialize data.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param pc the pc
 | 
			
		||||
	 */
 | 
			
		||||
	private void initializeData(ParkingChoice pc){
 | 
			
		||||
		ParkingClient client = new ParkingClient(this.getActivity());
 | 
			
		||||
		
 | 
			
		||||
@ -35,6 +48,9 @@ public class LotViewFragment extends DialogFragment {
 | 
			
		||||
		// Set up the MapView here.
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/* (non-Javadoc)
 | 
			
		||||
	 * @see android.app.Fragment#onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)
 | 
			
		||||
	 */
 | 
			
		||||
	@Override
 | 
			
		||||
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
 | 
			
		||||
            Bundle savedInstanceState) {
 | 
			
		||||
@ -58,6 +74,9 @@ public class LotViewFragment extends DialogFragment {
 | 
			
		||||
        return view;
 | 
			
		||||
    }
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * On submit rating.
 | 
			
		||||
	 */
 | 
			
		||||
	public void onSubmitRating() {
 | 
			
		||||
		// Submit a rating to the server
 | 
			
		||||
		SeekBar bar = (SeekBar)this.getView().findViewById(R.id.lotViewRateLot);
 | 
			
		||||
 | 
			
		||||
@ -12,40 +12,99 @@ import android.content.Intent;
 | 
			
		||||
import android.support.v4.app.NotificationCompat;
 | 
			
		||||
import android.support.v4.app.TaskStackBuilder;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class Alert.
 | 
			
		||||
 */
 | 
			
		||||
public class Alert {
 | 
			
		||||
	
 | 
			
		||||
	/** The alarm date. */
 | 
			
		||||
	private Date alarmDate;
 | 
			
		||||
	
 | 
			
		||||
	/** The message. */
 | 
			
		||||
	private String message;
 | 
			
		||||
	
 | 
			
		||||
	/** The shown. */
 | 
			
		||||
	private boolean shown;
 | 
			
		||||
	
 | 
			
		||||
	// Default constructor
 | 
			
		||||
	/**
 | 
			
		||||
	 * Instantiates a new alert.
 | 
			
		||||
	 */
 | 
			
		||||
	public Alert(){}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Instantiates a new alert.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param alarmDate the alarm date
 | 
			
		||||
	 * @param message the message
 | 
			
		||||
	 * @param shown the shown
 | 
			
		||||
	 */
 | 
			
		||||
	public Alert(Date alarmDate, String message, boolean shown) {
 | 
			
		||||
		this.setAlarmDate(alarmDate);
 | 
			
		||||
		this.setMessage(message);
 | 
			
		||||
		this.setShown(shown);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the alarm date.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the alarm date
 | 
			
		||||
	 */
 | 
			
		||||
	public Date getAlarmDate() {
 | 
			
		||||
		return alarmDate;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Sets the alarm date.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param alarmDate the new alarm date
 | 
			
		||||
	 */
 | 
			
		||||
	public void setAlarmDate(Date alarmDate) {
 | 
			
		||||
		this.alarmDate = alarmDate;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the message.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the message
 | 
			
		||||
	 */
 | 
			
		||||
	public String getMessage() {
 | 
			
		||||
		return message;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Sets the message.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param message the new message
 | 
			
		||||
	 */
 | 
			
		||||
	public void setMessage(String message) {
 | 
			
		||||
		this.message = message;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Checks if is shown.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return true, if is shown
 | 
			
		||||
	 */
 | 
			
		||||
	public boolean isShown() {
 | 
			
		||||
		return shown;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Sets the shown.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param shown the new shown
 | 
			
		||||
	 */
 | 
			
		||||
	public void setShown(boolean shown) {
 | 
			
		||||
		this.shown = shown;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Display notification.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param ctx the ctx
 | 
			
		||||
	 */
 | 
			
		||||
	public void displayNotification(Context ctx) {
 | 
			
		||||
		NotificationCompat.Builder builder = new NotificationCompat.Builder(ctx)
 | 
			
		||||
			.setSmallIcon(R.drawable.ic_launcher)
 | 
			
		||||
 | 
			
		||||
@ -3,33 +3,69 @@ package com.uncc.gameday.alerts;
 | 
			
		||||
import java.util.Date;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/* Responsible for handling persistence/fetching of alerts */
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * The Class AlertDB.
 | 
			
		||||
 */
 | 
			
		||||
public class AlertDB {
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Persist.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param a the a
 | 
			
		||||
	 */
 | 
			
		||||
	public void persist(Alert a) {
 | 
			
		||||
		
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Persist multiple.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param alerts the alerts
 | 
			
		||||
	 */
 | 
			
		||||
	public void persistMultiple(List<Alert> alerts) {
 | 
			
		||||
		
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Fetch.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param d the d
 | 
			
		||||
	 * @return the alert
 | 
			
		||||
	 */
 | 
			
		||||
	public Alert fetch(Date d) {
 | 
			
		||||
		
 | 
			
		||||
		return null;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Fetch multiple.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param dates the dates
 | 
			
		||||
	 * @return the list
 | 
			
		||||
	 */
 | 
			
		||||
	public List<Alert> fetchMultiple(List<Date> dates) {
 | 
			
		||||
		
 | 
			
		||||
		return null;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Fetch all.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the list
 | 
			
		||||
	 */
 | 
			
		||||
	public List<Alert> fetchAll() {
 | 
			
		||||
		
 | 
			
		||||
		return null;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Fetch unread.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the list
 | 
			
		||||
	 */
 | 
			
		||||
	public List<Alert> fetchUnread() {
 | 
			
		||||
		return null;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -14,11 +14,21 @@ import android.util.Log;
 | 
			
		||||
 | 
			
		||||
import com.uncc.gameday.R;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class AlertFetcher.
 | 
			
		||||
 */
 | 
			
		||||
public class AlertFetcher {
 | 
			
		||||
	// Class responsible for fetching all alerts as necessary.
 | 
			
		||||
	
 | 
			
		||||
	/** The max tweets. */
 | 
			
		||||
	private int maxTweets = 5;
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Fetch alerts.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param ctx the ctx
 | 
			
		||||
	 */
 | 
			
		||||
	public void fetchAlerts(Context ctx) {
 | 
			
		||||
		// Fetch all alerts. Responsible for discovering what sources need to be fetched.
 | 
			
		||||
		
 | 
			
		||||
@ -41,6 +51,12 @@ public class AlertFetcher {
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Fetch organization alerts.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param ctx the ctx
 | 
			
		||||
	 * @throws TwitterException the twitter exception
 | 
			
		||||
	 */
 | 
			
		||||
	private void fetchOrganizationAlerts(Context ctx) throws TwitterException {
 | 
			
		||||
		// Process fetching organization alerts (alerts retweeted by us)
 | 
			
		||||
		// Will not necessarily fetch `maxTweets` tweets.
 | 
			
		||||
@ -58,6 +74,12 @@ public class AlertFetcher {
 | 
			
		||||
		// List contains all valid alerts now
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Fetch university alerts.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param ctx the ctx
 | 
			
		||||
	 * @throws TwitterException the twitter exception
 | 
			
		||||
	 */
 | 
			
		||||
	private void fetchUniversityAlerts(Context ctx) throws TwitterException {
 | 
			
		||||
		// Process fetching university alerts
 | 
			
		||||
		// Guaranteed to get `maxTweets` tweets
 | 
			
		||||
@ -68,6 +90,12 @@ public class AlertFetcher {
 | 
			
		||||
		// List contains all valid alerts now
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Fetch gameday alerts.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param ctx the ctx
 | 
			
		||||
	 * @throws TwitterException the twitter exception
 | 
			
		||||
	 */
 | 
			
		||||
	private void fetchGamedayAlerts(Context ctx) throws TwitterException {
 | 
			
		||||
		// Process fetching alerts generated by staff of UNCCGameDay
 | 
			
		||||
		// Not guaranteed to get `maxTweets` tweets
 | 
			
		||||
@ -86,6 +114,12 @@ public class AlertFetcher {
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Creates the timed alerts.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param ctx the ctx
 | 
			
		||||
	 * @return the list
 | 
			
		||||
	 */
 | 
			
		||||
	public static List<Alert> createTimedAlerts(Context ctx) {
 | 
			
		||||
		// Create the timed alerts so we can add or remove them from the DB
 | 
			
		||||
		return null;
 | 
			
		||||
 | 
			
		||||
@ -5,13 +5,25 @@ import java.util.List;
 | 
			
		||||
import android.app.IntentService;
 | 
			
		||||
import android.content.Intent;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class AlertService.
 | 
			
		||||
 */
 | 
			
		||||
public class AlertService extends IntentService {
 | 
			
		||||
	
 | 
			
		||||
	/** The Constant name. */
 | 
			
		||||
	private static final String name = "AlertService";
 | 
			
		||||
 | 
			
		||||
	/**
 | 
			
		||||
	 * Instantiates a new alert service.
 | 
			
		||||
	 */
 | 
			
		||||
	public AlertService() {
 | 
			
		||||
		super(name);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* (non-Javadoc)
 | 
			
		||||
	 * @see android.app.IntentService#onHandleIntent(android.content.Intent)
 | 
			
		||||
	 */
 | 
			
		||||
	@Override
 | 
			
		||||
	protected void onHandleIntent(Intent intent) {
 | 
			
		||||
		// Go fetch all the alerts!
 | 
			
		||||
 | 
			
		||||
@ -1,19 +1,58 @@
 | 
			
		||||
package com.uncc.gameday.parking;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Enum ParkingChoice.
 | 
			
		||||
 */
 | 
			
		||||
public enum ParkingChoice {
 | 
			
		||||
	
 | 
			
		||||
	/** The green. */
 | 
			
		||||
	GREEN ("GREEN"),
 | 
			
		||||
	
 | 
			
		||||
	/** The black. */
 | 
			
		||||
	BLACK ("BLACK"),
 | 
			
		||||
	
 | 
			
		||||
	/** The red. */
 | 
			
		||||
	RED ("RED"),
 | 
			
		||||
	
 | 
			
		||||
	/** The blue. */
 | 
			
		||||
	BLUE ("BLUE"),
 | 
			
		||||
	
 | 
			
		||||
	/** The silver. */
 | 
			
		||||
	SILVER ("SILVER"),
 | 
			
		||||
	
 | 
			
		||||
	/** The orange. */
 | 
			
		||||
	ORANGE ("ORANGE"),
 | 
			
		||||
	
 | 
			
		||||
	/** The yellow. */
 | 
			
		||||
	YELLOW ("YELLOW"),
 | 
			
		||||
	
 | 
			
		||||
	/** The purple. */
 | 
			
		||||
	PURPLE ("PURPLE"),
 | 
			
		||||
	
 | 
			
		||||
	/** The pink. */
 | 
			
		||||
	PINK ("PINK"),
 | 
			
		||||
	
 | 
			
		||||
	/** The white. */
 | 
			
		||||
	WHITE ("WHITE"),
 | 
			
		||||
	
 | 
			
		||||
	/** The gold. */
 | 
			
		||||
	GOLD ("GOLD");
 | 
			
		||||
	
 | 
			
		||||
	/** The choice. */
 | 
			
		||||
	String choice;
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Instantiates a new parking choice.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param choice the choice
 | 
			
		||||
	 */
 | 
			
		||||
	ParkingChoice(String choice) { this.choice = choice; }
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the value.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the value
 | 
			
		||||
	 */
 | 
			
		||||
	public String getValue() { return choice; }
 | 
			
		||||
}
 | 
			
		||||
@ -8,10 +8,20 @@ import android.content.Context;
 | 
			
		||||
import com.uncc.gameday.R;
 | 
			
		||||
import com.uncc.gameday.rest.GamedayService;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class ParkingClient.
 | 
			
		||||
 */
 | 
			
		||||
public class ParkingClient {
 | 
			
		||||
 | 
			
		||||
	/** The gds. */
 | 
			
		||||
	private GamedayService gds;
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Instantiates a new parking client.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param c the c
 | 
			
		||||
	 */
 | 
			
		||||
	public ParkingClient(Context c) {
 | 
			
		||||
		RestAdapter ra = new RestAdapter.Builder()
 | 
			
		||||
			.setServer("http://" + c.getString(R.string.server_hostname))
 | 
			
		||||
@ -19,18 +29,41 @@ public class ParkingClient {
 | 
			
		||||
		gds = ra.create(GamedayService.class);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * List lots.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the list
 | 
			
		||||
	 */
 | 
			
		||||
	public List<ParkingLot> listLots() {
 | 
			
		||||
		return gds.listLots();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * List lot.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param choice the choice
 | 
			
		||||
	 * @return the parking lot
 | 
			
		||||
	 */
 | 
			
		||||
	public ParkingLot listLot(ParkingChoice choice) {
 | 
			
		||||
		return gds.listLot(choice.getValue());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * List lot.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param lot the lot
 | 
			
		||||
	 * @return the parking lot
 | 
			
		||||
	 */
 | 
			
		||||
	public ParkingLot listLot(ParkingLot lot) {
 | 
			
		||||
		return gds.listLot(lot.getLocation().getValue());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Rate lot.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param rating the rating
 | 
			
		||||
	 * @param parkingLot the parking lot
 | 
			
		||||
	 */
 | 
			
		||||
	public void rateLot(RatingChoices rating, ParkingChoice parkingLot) {
 | 
			
		||||
		ParkingRating pRating = new ParkingRating();
 | 
			
		||||
		pRating.setParkingLot(parkingLot);
 | 
			
		||||
@ -38,16 +71,33 @@ public class ParkingClient {
 | 
			
		||||
		gds.rateLot(pRating, new ParkingLotCallback());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Rate lot.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param rating the rating
 | 
			
		||||
	 */
 | 
			
		||||
	public void rateLot(ParkingRating rating) {
 | 
			
		||||
		gds.rateLot(rating, new ParkingLotCallback());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * List lot location.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param p the p
 | 
			
		||||
	 * @return the parking lot
 | 
			
		||||
	 */
 | 
			
		||||
	public ParkingLot listLotLocation(ParkingLot p){
 | 
			
		||||
		ParkingCoordinate pc = gds.listLotLocation(p.getLocation().getValue());
 | 
			
		||||
		p.setCoordinate(pc);
 | 
			
		||||
		return p;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * List lot location.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param c the c
 | 
			
		||||
	 * @return the parking lot
 | 
			
		||||
	 */
 | 
			
		||||
	public ParkingLot listLotLocation(ParkingChoice c) {
 | 
			
		||||
		ParkingCoordinate pc = gds.listLotLocation(c.getValue());
 | 
			
		||||
		ParkingLot pl = new ParkingLot();
 | 
			
		||||
 | 
			
		||||
@ -3,40 +3,102 @@ package com.uncc.gameday.parking;
 | 
			
		||||
import android.content.Intent;
 | 
			
		||||
import android.net.Uri;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class ParkingCoordinate.
 | 
			
		||||
 */
 | 
			
		||||
public class ParkingCoordinate {
 | 
			
		||||
	
 | 
			
		||||
	/** The latitude. */
 | 
			
		||||
	private double latitude;
 | 
			
		||||
	
 | 
			
		||||
	/** The longitude. */
 | 
			
		||||
	private double longitude;
 | 
			
		||||
	
 | 
			
		||||
	/** The label. */
 | 
			
		||||
	private String label;
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the latitude.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the latitude
 | 
			
		||||
	 */
 | 
			
		||||
	public double getLatitude() {
 | 
			
		||||
		return latitude;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Sets the latitude.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param latitude the new latitude
 | 
			
		||||
	 */
 | 
			
		||||
	public void setLatitude(double latitude) {
 | 
			
		||||
		this.latitude = latitude;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the longitude.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the longitude
 | 
			
		||||
	 */
 | 
			
		||||
	public double getLongitude() {
 | 
			
		||||
		return longitude;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Sets the longitude.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param longitude the new longitude
 | 
			
		||||
	 */
 | 
			
		||||
	public void setLongitude(double longitude) {
 | 
			
		||||
		this.longitude = longitude;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the label.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the label
 | 
			
		||||
	 */
 | 
			
		||||
	public String getLabel() {
 | 
			
		||||
		return label;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Sets the label.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param label the new label
 | 
			
		||||
	 */
 | 
			
		||||
	public void setLabel(String label) {
 | 
			
		||||
		this.label = label;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the navigation uri.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the navigation uri
 | 
			
		||||
	 */
 | 
			
		||||
	public Uri getNavigationURI() {
 | 
			
		||||
		// URI used to construct an intent for navigation
 | 
			
		||||
		return Uri.parse("google.navigation:q=" + this.getLatitude() + "," + this.getLongitude());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the navigation intent.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the navigation intent
 | 
			
		||||
	 */
 | 
			
		||||
	public Intent getNavigationIntent() {
 | 
			
		||||
		// Intent used to do navigation
 | 
			
		||||
		return new Intent(Intent.ACTION_VIEW, this.getNavigationURI());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Instantiates a new parking coordinate.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param latitude the latitude
 | 
			
		||||
	 * @param longitude the longitude
 | 
			
		||||
	 * @param label the label
 | 
			
		||||
	 */
 | 
			
		||||
	public ParkingCoordinate(double latitude, double longitude, String label) {
 | 
			
		||||
		this.latitude = latitude;
 | 
			
		||||
		this.longitude = longitude;
 | 
			
		||||
 | 
			
		||||
@ -1,26 +1,70 @@
 | 
			
		||||
package com.uncc.gameday.parking;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class ParkingLot.
 | 
			
		||||
 */
 | 
			
		||||
public class ParkingLot {
 | 
			
		||||
	
 | 
			
		||||
	/** The location. */
 | 
			
		||||
	private ParkingChoice location;
 | 
			
		||||
	
 | 
			
		||||
	/** The filled_pct. */
 | 
			
		||||
	private int filled_pct;
 | 
			
		||||
	
 | 
			
		||||
	/** The coordinate. */
 | 
			
		||||
	private ParkingCoordinate coordinate;
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the filled pct.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the filled pct
 | 
			
		||||
	 */
 | 
			
		||||
	public int getFilledPct() {
 | 
			
		||||
		return filled_pct;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Sets the filled pct.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param filled_pct the new filled pct
 | 
			
		||||
	 */
 | 
			
		||||
	public void setFilledPct(int filled_pct) {
 | 
			
		||||
		this.filled_pct = filled_pct;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the location.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the location
 | 
			
		||||
	 */
 | 
			
		||||
	public ParkingChoice getLocation() {
 | 
			
		||||
		return location;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Sets the location.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param location the new location
 | 
			
		||||
	 */
 | 
			
		||||
	public void setLocation(ParkingChoice location) {
 | 
			
		||||
		this.location = location;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the coordinate.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the coordinate
 | 
			
		||||
	 */
 | 
			
		||||
	public ParkingCoordinate getCoordinate() {
 | 
			
		||||
		return coordinate;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Sets the coordinate.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param coordinate the new coordinate
 | 
			
		||||
	 */
 | 
			
		||||
	public void setCoordinate(ParkingCoordinate coordinate) {
 | 
			
		||||
		this.coordinate = coordinate;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -5,13 +5,23 @@ import retrofit.Callback;
 | 
			
		||||
import retrofit.RetrofitError;
 | 
			
		||||
import retrofit.client.Response;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class ParkingLotCallback.
 | 
			
		||||
 */
 | 
			
		||||
public class ParkingLotCallback implements Callback<ParkingLot> {
 | 
			
		||||
 | 
			
		||||
	/* (non-Javadoc)
 | 
			
		||||
	 * @see retrofit.Callback#failure(retrofit.RetrofitError)
 | 
			
		||||
	 */
 | 
			
		||||
	@Override
 | 
			
		||||
	public void failure(RetrofitError e) {
 | 
			
		||||
		Log.w("ParkingLotCallback", e.getMessage());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* (non-Javadoc)
 | 
			
		||||
	 * @see retrofit.Callback#success(java.lang.Object, retrofit.client.Response)
 | 
			
		||||
	 */
 | 
			
		||||
	@Override
 | 
			
		||||
	public void success(ParkingLot p, Response r) {
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
@ -1,18 +1,49 @@
 | 
			
		||||
package com.uncc.gameday.parking;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class ParkingRating.
 | 
			
		||||
 */
 | 
			
		||||
public class ParkingRating  {
 | 
			
		||||
	
 | 
			
		||||
	/** The parking_lot. */
 | 
			
		||||
	private ParkingChoice parking_lot;
 | 
			
		||||
	
 | 
			
		||||
	/** The rating. */
 | 
			
		||||
	private RatingChoices rating;
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the parking lot.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the parking lot
 | 
			
		||||
	 */
 | 
			
		||||
	public ParkingChoice getParkingLot() {
 | 
			
		||||
		return parking_lot;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Sets the parking lot.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param parking_lot the new parking lot
 | 
			
		||||
	 */
 | 
			
		||||
	public void setParkingLot(ParkingChoice parking_lot) {
 | 
			
		||||
		this.parking_lot = parking_lot;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the rating.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the rating
 | 
			
		||||
	 */
 | 
			
		||||
	public RatingChoices getRating() {
 | 
			
		||||
		return rating;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Sets the rating.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param rating the new rating
 | 
			
		||||
	 */
 | 
			
		||||
	public void setRating(RatingChoices rating) {
 | 
			
		||||
		this.rating = rating;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -1,12 +1,37 @@
 | 
			
		||||
package com.uncc.gameday.parking;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Enum RatingChoices.
 | 
			
		||||
 */
 | 
			
		||||
public enum RatingChoices {
 | 
			
		||||
	
 | 
			
		||||
	/** The emp. */
 | 
			
		||||
	EMP ("EMPTY"),
 | 
			
		||||
	
 | 
			
		||||
	/** The sct. */
 | 
			
		||||
	SCT ("SCATTERED"),
 | 
			
		||||
	
 | 
			
		||||
	/** The bsy. */
 | 
			
		||||
	BSY ("BUSY"),
 | 
			
		||||
	
 | 
			
		||||
	/** The fll. */
 | 
			
		||||
	FLL ("FULL");
 | 
			
		||||
	
 | 
			
		||||
	/** The choice. */
 | 
			
		||||
	String choice;
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Instantiates a new rating choices.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param choice the choice
 | 
			
		||||
	 */
 | 
			
		||||
	RatingChoices(String choice) { this.choice = choice; }
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the value.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the value
 | 
			
		||||
	 */
 | 
			
		||||
	public String getValue() { return choice; }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,40 +1,112 @@
 | 
			
		||||
package com.uncc.gameday.registration;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class Attendee.
 | 
			
		||||
 */
 | 
			
		||||
public class Attendee {
 | 
			
		||||
	
 | 
			
		||||
	/** The id. */
 | 
			
		||||
	private int id;
 | 
			
		||||
	
 | 
			
		||||
	/** The first_name. */
 | 
			
		||||
	private String first_name;
 | 
			
		||||
	
 | 
			
		||||
	/** The last_name. */
 | 
			
		||||
	private String last_name;
 | 
			
		||||
	
 | 
			
		||||
	/** The section. */
 | 
			
		||||
	private String section;
 | 
			
		||||
	
 | 
			
		||||
	/** The row. */
 | 
			
		||||
	private int row;
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the first name.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the first name
 | 
			
		||||
	 */
 | 
			
		||||
	public String getFirstName() {
 | 
			
		||||
		return first_name;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Sets the first name.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param first_name the new first name
 | 
			
		||||
	 */
 | 
			
		||||
	public void setFirstName(String first_name) {
 | 
			
		||||
		this.first_name = first_name;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the last name.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the last name
 | 
			
		||||
	 */
 | 
			
		||||
	public String getLastName() {
 | 
			
		||||
		return last_name;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Sets the last name.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param last_name the new last name
 | 
			
		||||
	 */
 | 
			
		||||
	public void setLastName(String last_name) {
 | 
			
		||||
		this.last_name = last_name;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the section.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the section
 | 
			
		||||
	 */
 | 
			
		||||
	public String getSection() {
 | 
			
		||||
		return section;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Sets the section.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param section the new section
 | 
			
		||||
	 */
 | 
			
		||||
	public void setSection(String section) {
 | 
			
		||||
		this.section = section;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the row.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the row
 | 
			
		||||
	 */
 | 
			
		||||
	public int getRow() {
 | 
			
		||||
		return row;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Sets the row.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param row the new row
 | 
			
		||||
	 */
 | 
			
		||||
	public void setRow(int row) {
 | 
			
		||||
		this.row = row;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the id.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the id
 | 
			
		||||
	 */
 | 
			
		||||
	public int getId() {
 | 
			
		||||
		return id;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Sets the id.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param id the new id
 | 
			
		||||
	 */
 | 
			
		||||
	public void setId(int id) {
 | 
			
		||||
		this.id = id;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -5,13 +5,23 @@ import retrofit.Callback;
 | 
			
		||||
import retrofit.RetrofitError;
 | 
			
		||||
import retrofit.client.Response;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class AttendeeCallback.
 | 
			
		||||
 */
 | 
			
		||||
public class AttendeeCallback implements Callback<Attendee> {
 | 
			
		||||
 | 
			
		||||
	/* (non-Javadoc)
 | 
			
		||||
	 * @see retrofit.Callback#failure(retrofit.RetrofitError)
 | 
			
		||||
	 */
 | 
			
		||||
	@Override
 | 
			
		||||
	public void failure(RetrofitError e) {
 | 
			
		||||
		Log.w("AttendeeCallback", e.getMessage());		
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* (non-Javadoc)
 | 
			
		||||
	 * @see retrofit.Callback#success(java.lang.Object, retrofit.client.Response)
 | 
			
		||||
	 */
 | 
			
		||||
	@Override
 | 
			
		||||
	public void success(Attendee a, Response r) {
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
@ -8,10 +8,20 @@ import android.content.Context;
 | 
			
		||||
import com.uncc.gameday.R;
 | 
			
		||||
import com.uncc.gameday.rest.GamedayService;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class RegistrationClient.
 | 
			
		||||
 */
 | 
			
		||||
public class RegistrationClient {
 | 
			
		||||
	
 | 
			
		||||
	/** The gds. */
 | 
			
		||||
	private GamedayService gds;
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Instantiates a new registration client.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param c the c
 | 
			
		||||
	 */
 | 
			
		||||
	public RegistrationClient(Context c) {
 | 
			
		||||
		RestAdapter ra = new RestAdapter.Builder()
 | 
			
		||||
			.setServer("http://" + c.getString(R.string.server_hostname))
 | 
			
		||||
@ -19,18 +29,40 @@ public class RegistrationClient {
 | 
			
		||||
		gds = ra.create(GamedayService.class);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Register attendee.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param a the a
 | 
			
		||||
	 */
 | 
			
		||||
	public void registerAttendee(Attendee a) {
 | 
			
		||||
		gds.registerUser(a, new AttendeeCallback());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * List attendee.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param id the id
 | 
			
		||||
	 * @return the attendee
 | 
			
		||||
	 */
 | 
			
		||||
	public Attendee listAttendee(int id) {
 | 
			
		||||
		return gds.getUser(id);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * List attendee.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param a the a
 | 
			
		||||
	 * @return the attendee
 | 
			
		||||
	 */
 | 
			
		||||
	public Attendee listAttendee(Attendee a) {
 | 
			
		||||
		return gds.getUser(a.getFirstName(), a.getLastName());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * List attendees.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the list
 | 
			
		||||
	 */
 | 
			
		||||
	public List<Attendee> listAttendees() {
 | 
			
		||||
		return gds.getAllUsers();
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -13,29 +13,80 @@ import com.uncc.gameday.parking.ParkingLot;
 | 
			
		||||
import com.uncc.gameday.parking.ParkingRating;
 | 
			
		||||
import com.uncc.gameday.registration.Attendee;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Interface GamedayService.
 | 
			
		||||
 */
 | 
			
		||||
public interface GamedayService {
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * List lots.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the list
 | 
			
		||||
	 */
 | 
			
		||||
	@GET("/lots/")
 | 
			
		||||
	List<ParkingLot> listLots();
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * List lot.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param lot the lot
 | 
			
		||||
	 * @return the parking lot
 | 
			
		||||
	 */
 | 
			
		||||
	@GET("/lots/{lot}/")
 | 
			
		||||
	ParkingLot listLot(@Path("lot") String lot);
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Rate lot.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param p the p
 | 
			
		||||
	 * @param lot the lot
 | 
			
		||||
	 */
 | 
			
		||||
	@POST("/lots/rate/")
 | 
			
		||||
	void rateLot(@Body ParkingRating p, Callback<ParkingLot> lot);
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * List lot location.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param lot the lot
 | 
			
		||||
	 * @return the parking coordinate
 | 
			
		||||
	 */
 | 
			
		||||
	@GET("/lots/{lot}/")
 | 
			
		||||
	ParkingCoordinate listLotLocation(@Path("lot") String lot);
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the user.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param id the id
 | 
			
		||||
	 * @return the user
 | 
			
		||||
	 */
 | 
			
		||||
	@GET("/register/{id}/")
 | 
			
		||||
	Attendee getUser(@Path("id") int id);
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the user.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param firstName the first name
 | 
			
		||||
	 * @param lastName the last name
 | 
			
		||||
	 * @return the user
 | 
			
		||||
	 */
 | 
			
		||||
	@GET("/register/{fname}/{lname}/")
 | 
			
		||||
	Attendee getUser(@Path("fname") String firstName, @Path("lname") String lastName);
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Gets the all users.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @return the all users
 | 
			
		||||
	 */
 | 
			
		||||
	@GET("/register/")
 | 
			
		||||
	List<Attendee> getAllUsers();
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Register user.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param a the a
 | 
			
		||||
	 * @param attendee the attendee
 | 
			
		||||
	 */
 | 
			
		||||
	@POST("/register/")
 | 
			
		||||
	void registerUser(@Body Attendee a, Callback<Attendee> attendee);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -11,14 +11,29 @@ import twitter4j.TwitterFactory;
 | 
			
		||||
import twitter4j.conf.Configuration;
 | 
			
		||||
import twitter4j.conf.ConfigurationBuilder;
 | 
			
		||||
 | 
			
		||||
// TODO: Auto-generated Javadoc
 | 
			
		||||
/**
 | 
			
		||||
 * The Class TwitterClient.
 | 
			
		||||
 */
 | 
			
		||||
public class TwitterClient {
 | 
			
		||||
	
 | 
			
		||||
	/** The Constant CONSUMER_KEY. */
 | 
			
		||||
	static final String CONSUMER_KEY = "vfRa3Tr5QYaU8Jr2pKHtiA";
 | 
			
		||||
	
 | 
			
		||||
	/** The Constant CONSUMER_SECRET. */
 | 
			
		||||
	static final String CONSUMER_SECRET = "gGRdIrhPdX2Vrg296xOvTqE4sgOISMphRmPdrGirbU";
 | 
			
		||||
	
 | 
			
		||||
	/** The c. */
 | 
			
		||||
	Configuration c;
 | 
			
		||||
	
 | 
			
		||||
	/** The t. */
 | 
			
		||||
	Twitter t;
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Instantiates a new twitter client.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @throws TwitterException the twitter exception
 | 
			
		||||
	 */
 | 
			
		||||
	public TwitterClient() throws TwitterException {
 | 
			
		||||
		ConfigurationBuilder cb = new ConfigurationBuilder();
 | 
			
		||||
		cb.setApplicationOnlyAuthEnabled(true).setUseSSL(true);
 | 
			
		||||
@ -28,6 +43,12 @@ public class TwitterClient {
 | 
			
		||||
		t.getOAuth2Token();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Fetch tweets.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param handle the handle
 | 
			
		||||
	 * @return the list
 | 
			
		||||
	 */
 | 
			
		||||
	public List<Status> fetchTweets(String handle) {
 | 
			
		||||
		try {
 | 
			
		||||
			return t.getUserTimeline(handle);
 | 
			
		||||
@ -38,6 +59,13 @@ public class TwitterClient {
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	/**
 | 
			
		||||
	 * Fetch tweets.
 | 
			
		||||
	 *
 | 
			
		||||
	 * @param handle the handle
 | 
			
		||||
	 * @param count the count
 | 
			
		||||
	 * @return the list
 | 
			
		||||
	 */
 | 
			
		||||
	public List<Status> fetchTweets(String handle, int count) {
 | 
			
		||||
		try {
 | 
			
		||||
			return t.getUserTimeline(handle, new Paging(1, count));
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user