1
0
mirror of https://github.com/bspeice/itcs4180 synced 2024-09-28 21:51:38 -04:00

Removed unused resources. Removed unused imports. Removed debug code.

This commit is contained in:
tokugawa 2014-04-29 14:22:27 -04:00
parent 7b732e38f6
commit 0ee4a4ffe2
10 changed files with 2 additions and 75 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

@ -16,14 +16,6 @@
android:text="@string/found_text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/numberFoundText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/default_text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<WebView
android:id="@+id/moreInfoWebView"
android:layout_width="match_parent"

View File

@ -11,9 +11,6 @@ package edu.uncc.scavenger;
* stackoverflow.com/questions/5479753/using-orientation-sensor-to-point-towards-a-specific-location
*/
import java.util.ArrayList;
import java.util.List;
import edu.uncc.scavenger.rest.RestLocation;
import android.app.Activity;
import android.content.Context;
@ -26,12 +23,10 @@ import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;
public class CompassActivity extends Activity implements SensorEventListener
{
@ -48,7 +43,6 @@ public class CompassActivity extends Activity implements SensorEventListener
float[] gravity = new float[3];
float[] magneticField = new float[3];
float[] coordinates = new float[3];
//ArrayList<Float> rotationAverage = new ArrayList<Float>(MOVING_AVERAGE_SIZE);
LocationManager locationManager;
DirectionListener locationListener;
Location searchLocation;
@ -70,13 +64,6 @@ public class CompassActivity extends Activity implements SensorEventListener
searchImageView.setImageBitmap(b);
}
/*Test Values
searchLocation.setLatitude(35.30719258);//woodward eagle
searchLocation.setLongitude(-80.73505447);
searchLocation = new Location(LocationManager.NETWORK_PROVIDER);
searchLocation.setLatitude(35.310043);//Bottom of Student Union bridge
searchLocation.setLongitude(-80.733734);*/
searchLocation = new Location(LocationManager.NETWORK_PROVIDER);
searchLocation.setLatitude((float)(restLocation.getLocationLat()));
searchLocation.setLongitude((float)(restLocation.getLocationLong()));
@ -97,8 +84,6 @@ public class CompassActivity extends Activity implements SensorEventListener
finish();
}
});
//Toast.makeText(this, ""+searchLocation.getLatitude()+", "+searchLocation.getLongitude(), Toast.LENGTH_SHORT).show();
}
@Override
@ -149,21 +134,11 @@ public class CompassActivity extends Activity implements SensorEventListener
SensorManager.getOrientation(rotation, compassValues);
//Calculate true north and angle to desired location
//float azimuth = (float) (Math.toDegrees(compassValues[0]));
float trueHeading = (float)(Math.toDegrees(compassValues[0]) + locationListener.getDeclination());
//Calculate bearing to search location
float rotateArrow = (float) (trueHeading - locationListener.getBearing());
//Add rotate average later. Does not handle wrap around when exactly at 0 degrees
/* Take moving average of bearing to smooth it out
if (rotationAverage.size() == MOVING_AVERAGE_SIZE) {
rotationAverage.remove(0);
}
rotationAverage.add(rotateArrow);
float finalRotation = findAverage(rotationAverage);*/
//Rotate compass and arrow. Rotations must be opposite to counteract device movement
//Rotate compass pointer accordingly
arrowView.setRotation((long)(-1 * rotateArrow));
if(locationListener.getDistance() <= SEARCH_PROXIMITY)
@ -183,13 +158,4 @@ public class CompassActivity extends Activity implements SensorEventListener
// TODO Auto-generated method stub
}
/*private float findAverage(List<Float> list) {
float sum = 0.0f;
for (Float f : list) {
sum += f;
}
Toast.makeText(CompassActivity.this, ""+(sum/list.size()), Toast.LENGTH_SHORT).show();
return sum / list.size();
}*/
}

View File

@ -11,7 +11,6 @@ import android.hardware.GeomagneticField;
import android.location.Location;
import android.location.LocationListener;
import android.os.Bundle;
import android.widget.TextView;
public class DirectionListener implements LocationListener
{
@ -30,8 +29,6 @@ public class DirectionListener implements LocationListener
@Override
public void onLocationChanged(Location location)
{
//String lat = ""+location.getLatitude();
//String lon = ""+location.getLongitude();
geoField = new GeomagneticField(
(float)location.getLatitude(),

View File

@ -12,17 +12,13 @@ import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewDebug.FlagToString;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.TextView;
public class FoundActivity extends Activity {
TextView numberFoundText;
Button tryMoreButton;
WebView moreInfoWebView;
Intent intent;
@ -33,12 +29,9 @@ public class FoundActivity extends Activity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_found);
numberFoundText = (TextView)findViewById(R.id.numberFoundText);
moreInfoWebView = (WebView)findViewById(R.id.moreInfoWebView);
tryMoreButton = (Button)findViewById(R.id.tryMoreButton);
numberFoundText.setVisibility(View.INVISIBLE);
restLocation = (RestLocation)(getIntent().getSerializableExtra("restLocation"));
moreInfoWebView.loadData(restLocation.getKey(), "text/html", "UTF-8");

View File

@ -12,7 +12,6 @@ import java.util.List;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
@ -22,7 +21,6 @@ import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import edu.uncc.scavenger.database.LocationDatabaseHelper;
import edu.uncc.scavenger.rest.LocationClient;
import edu.uncc.scavenger.rest.RestLocation;
@ -39,21 +37,6 @@ public class MainActivity extends Activity {
locationList = (ListView)findViewById(R.id.listLocations);
/*Test Code for mock location
RestLocation location = new RestLocation();
location.setId(1);
location.setName("Bridge");
location.setRiddle("Riddle");
location.setLocationLong(-80.733734);
location.setLocationLat(35.310043);
location.setKey("Key");
location.setRiddleImageURL("http://rmss.uncc.edu/sites/rmss.uncc.edu/files/media/Belk%20Tower.jpg");
Intent intent = new Intent(getApplicationContext(), SearchActivity.class);
intent.putExtra("restLocation", location);
startActivity(intent);
finish();
/*End Test Code*/
// Get our list of events loaded
locationList = (ListView)findViewById(R.id.listLocations);
locations = LocationDatabaseHelper.getInstance(this).fetchAll();
@ -74,7 +57,6 @@ public class MainActivity extends Activity {
// We don't yet have any locations...
((TextView)findViewById(R.id.txtNoLocations)).setVisibility(View.VISIBLE);
((ListView)findViewById(R.id.listLocations)).setVisibility(View.GONE);
//Log.d("Location", "NoLocations");
}
// And kick off contacting to server to see if there are any new ones

View File

@ -177,7 +177,7 @@ public class SearchActivity extends Activity {
protected void onPostExecute(String result) {
super.onPostExecute(result);
key = result;
//Toast.makeText(getApplicationContext(), key, Toast.LENGTH_SHORT).show();
if(key!= null)
{
restLocation.setKey(key);

View File

@ -17,9 +17,7 @@ import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteStatement;
public class LocationDatabaseHelper extends SQLiteOpenHelper {

View File

@ -20,7 +20,6 @@ import retrofit.RetrofitError;
import retrofit.converter.GsonConverter;
import android.content.Context;
import android.os.AsyncTask;
import android.util.Log;
import edu.uncc.scavenger.R;
public class LocationClient {