use of ca.etsmtl.applets.etsmobile.model.applets_events.EvenementCommunauteList in project ETSMobile-Android2 by ApplETS.
the class AppletsApiEvenementsRequest method loadDataFromNetwork.
@Override
public EvenementCommunauteList loadDataFromNetwork() throws Exception {
String eventsAddress = context.getString(R.string.applets_api_events, source.getKey());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder().url(eventsAddress).get().build();
Response response = client.newCall(request).execute();
String result = response.body().string();
EvenementCommunauteList evenementList = new Gson().fromJson(result, EvenementCommunauteList.class);
for (EvenementCommunaute event : evenementList) {
event.setSourceEvenement(source);
}
return evenementList;
}
Aggregations