use of ca.etsmtl.applets.etsmobile.model.SponsorList in project ETSMobile-Android2 by ApplETS.
the class AppletsApiSponsorRequest method loadDataFromNetwork.
@Override
public SponsorList loadDataFromNetwork() throws Exception {
String address = context.getString(R.string.applets_api_sponsors);
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder().url(address).get().build();
Response response = client.newCall(request).execute();
String result = response.body().string();
SponsorList sponsors = new Gson().fromJson(result, SponsorList.class);
return sponsors;
}
Aggregations