Add the new (and tested!) RegistrationClient

This commit is contained in:
bspeice 2013-10-18 17:46:37 -04:00
parent 70dac422e1
commit d6586d3ac9

View File

@ -0,0 +1,32 @@
package com.uncc.gameday.registration;
import java.util.List;
import com.uncc.gameday.R;
import android.content.Context;
import android.util.Log;
import retrofit.RestAdapter;
import retrofit.RetrofitError;
public class RegistrationClient {
private GamedayService gds;
public RegistrationClient(Context c) {
RestAdapter ra = new RestAdapter.Builder()
.setServer("http://" + c.getString(R.string.server_hostname))
.build();
gds = ra.create(GamedayService.class);
}
public List<ParkingLot> listLots() {
try {
return gds.listLots();
} catch (RetrofitError e) {
Log.w("Registration.listLots()", e);
return null;
}
}
}