Search in sources :

Example 1 with FourSquareModel

use of com.example.c4q.capstone.network.foursquare.foursquaremodel.FourSquareModel in project Grupp by tmoronta1208.

the class FourSNetworkCall method start.

public static void start(final String zipcode) {
    Retrofit retrofit = new Retrofit.Builder().baseUrl(Constants.FOUR_SQUARE_URL).addConverterFactory(GsonConverterFactory.create()).build();
    final FourSService fourSService = retrofit.create(FourSService.class);
    for (int i = 0; i < BarPreferencesFragment.selectedPrefs.size(); i++) {
        Call<FourSquareModel> call = fourSService.getVenues("11224", "10001", "beer", "20180328");
        call.enqueue(new Callback<FourSquareModel>() {

            @Override
            public void onResponse(Call<FourSquareModel> call, Response<FourSquareModel> response) {
                Log.d("SUCESSSS", response.body().getResponse().getVenues().get(0).getName());
            }

            @Override
            public void onFailure(Call<FourSquareModel> call, Throwable t) {
                t.printStackTrace();
            }
        });
    }
}
Also used : Retrofit(retrofit2.Retrofit) FourSquareModel(com.example.c4q.capstone.network.foursquare.foursquaremodel.FourSquareModel)

Aggregations

FourSquareModel (com.example.c4q.capstone.network.foursquare.foursquaremodel.FourSquareModel)1 Retrofit (retrofit2.Retrofit)1