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