diff --git a/UNCCScavenger/src/edu/uncc/scavenger/rest/LocationClient.java b/UNCCScavenger/src/edu/uncc/scavenger/rest/LocationClient.java index b465f1d..927bd7b 100644 --- a/UNCCScavenger/src/edu/uncc/scavenger/rest/LocationClient.java +++ b/UNCCScavenger/src/edu/uncc/scavenger/rest/LocationClient.java @@ -33,12 +33,12 @@ public class LocationClient { return client.getResult(keys); } - public List getLocations() { + public List getLocations() { try { // Inline AsyncTask - return new AsyncTask>() { + return new AsyncTask>() { @Override - protected List doInBackground(Void... params) { + protected List doInBackground(Void... params) { // Work happens here return getAdapter().listLocations(); } diff --git a/UNCCScavenger/src/edu/uncc/scavenger/rest/LocationService.java b/UNCCScavenger/src/edu/uncc/scavenger/rest/LocationService.java index 2282627..61c4372 100644 --- a/UNCCScavenger/src/edu/uncc/scavenger/rest/LocationService.java +++ b/UNCCScavenger/src/edu/uncc/scavenger/rest/LocationService.java @@ -9,7 +9,7 @@ import retrofit.http.QueryMap; public interface LocationService { @GET("/locations") - List listLocations(); + List listLocations(); @GET("/validate") String getResult(@QueryMap Map keys); diff --git a/UNCCScavenger/src/edu/uncc/scavenger/rest/Location.java b/UNCCScavenger/src/edu/uncc/scavenger/rest/RestLocation.java similarity index 79% rename from UNCCScavenger/src/edu/uncc/scavenger/rest/Location.java rename to UNCCScavenger/src/edu/uncc/scavenger/rest/RestLocation.java index 6b2372e..448edb2 100644 --- a/UNCCScavenger/src/edu/uncc/scavenger/rest/Location.java +++ b/UNCCScavenger/src/edu/uncc/scavenger/rest/RestLocation.java @@ -1,6 +1,8 @@ package edu.uncc.scavenger.rest; -public class Location { +import android.location.Location; + +public class RestLocation { private int id; private String name; @@ -39,14 +41,14 @@ public class Location { this.locationLat = locationLat; } - private android.location.Location getAndroidLocation() { + public Location getLocation() { android.location.Location mLocation = new android.location.Location("NinerFinderServer"); mLocation.setLatitude(getLocationLat()); mLocation.setLongitude(getLocationLong()); return mLocation; } - public float bearingTo(Location target) { - return getAndroidLocation().bearingTo(target.getAndroidLocation()); + public float bearingTo(RestLocation target) { + return getLocation().bearingTo(target.getLocation()); } }