mirror of
https://github.com/bspeice/itcs4180
synced 2024-12-04 13:18:16 -05:00
RestLocations created correctly from the server.
This commit is contained in:
parent
6e2ad36f09
commit
60062298bc
@ -53,6 +53,7 @@ public class MainActivity extends Activity {
|
||||
/*End Test Code*/
|
||||
|
||||
// And kick off contacting to server to see if there are any new ones
|
||||
locationList = (ListView)findViewById(R.id.listLocations);
|
||||
new LocationClient.LocationsDownloader(this) {
|
||||
@Override
|
||||
protected void onPostExecute(List<RestLocation> result) {
|
||||
|
@ -138,7 +138,7 @@ public class SearchActivity extends Activity {
|
||||
}
|
||||
else
|
||||
{
|
||||
new ImageDownloader().execute(restLocation.getRiddleImageURL());
|
||||
new ImageDownloader().execute(restLocation.getRiddleImageUrl());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,12 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gson.FieldNamingPolicy;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import retrofit.RestAdapter;
|
||||
import retrofit.converter.GsonConverter;
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
import edu.uncc.scavenger.R;
|
||||
@ -20,7 +25,10 @@ public class LocationClient {
|
||||
|
||||
private static LocationService getAdapter(Context ctx) {
|
||||
String endpoint = ctx.getString(R.string.endpoint);
|
||||
Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES)
|
||||
.create();
|
||||
RestAdapter ra = new RestAdapter.Builder().setEndpoint(endpoint)
|
||||
.setConverter(new GsonConverter(gson))
|
||||
.build();
|
||||
return ra.create(LocationService.class);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ public class RestLocation implements Serializable{
|
||||
private String riddle;
|
||||
private double locationLong;
|
||||
private double locationLat;
|
||||
private String riddleImageURL;
|
||||
private String riddleImageUrl;
|
||||
private String key;
|
||||
|
||||
public int getId() {
|
||||
@ -57,11 +57,11 @@ public class RestLocation implements Serializable{
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
public String getRiddleImageURL() {
|
||||
return riddleImageURL;
|
||||
public String getRiddleImageUrl() {
|
||||
return riddleImageUrl;
|
||||
}
|
||||
public void setRiddleImageURL(String riddleImageURL) {
|
||||
this.riddleImageURL = riddleImageURL;
|
||||
public void setRiddleImageUrl(String riddleImageUrl) {
|
||||
this.riddleImageUrl = riddleImageUrl;
|
||||
}
|
||||
|
||||
public Location getLocation() {
|
||||
|
Loading…
Reference in New Issue
Block a user