mirror of
https://github.com/bspeice/UNCCGameDay
synced 2024-11-05 07:38:13 -05:00
Add the new (and tested!) RegistrationClient
This commit is contained in:
parent
70dac422e1
commit
d6586d3ac9
32
src/com/uncc/gameday/registration/RegistrationClient.java
Normal file
32
src/com/uncc/gameday/registration/RegistrationClient.java
Normal 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user