mirror of
https://github.com/bspeice/itcs4180
synced 2024-12-04 21:28:10 -05:00
Successfully contact the server
This commit is contained in:
parent
9219578b84
commit
22d8236bf6
@ -6,7 +6,8 @@
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="11"
|
||||
android:targetSdkVersion="19" />
|
||||
android:targetSdkVersion="19" />
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
|
BIN
UNCCScavenger/libs/gson-2.2.4.jar
Normal file
BIN
UNCCScavenger/libs/gson-2.2.4.jar
Normal file
Binary file not shown.
@ -3,9 +3,11 @@ package edu.uncc.scavenger.rest;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import edu.uncc.scavenger.R;
|
||||
import android.content.Context;
|
||||
import android.os.AsyncTask;
|
||||
|
||||
import retrofit.RestAdapter;
|
||||
|
||||
@ -32,6 +34,23 @@ public class LocationClient {
|
||||
}
|
||||
|
||||
public List<Location> getLocations() {
|
||||
return getAdapter().listLocations();
|
||||
try {
|
||||
// Inline AsyncTask
|
||||
return new AsyncTask<Void, Void, List<Location>>() {
|
||||
@Override
|
||||
protected List<Location> doInBackground(Void... params) {
|
||||
// Work happens here
|
||||
return getAdapter().listLocations();
|
||||
}
|
||||
}.get();
|
||||
} catch (InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} catch (ExecutionException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user