Android Open Source - android-cd-travis-example City Json Request






From Project

Back to project page android-cd-travis-example.

License

The source code is released under:

MIT License

If you think the Android project android-cd-travis-example listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.ruenzuo.weatherapp.requests;
//from w w  w . j  a  va  2  s .  com
import android.location.Location;

import com.octo.android.robospice.request.springandroid.SpringAndroidSpiceRequest;
import com.ruenzuo.weatherapp.pojos.ListCities;

public class CityJsonRequest extends SpringAndroidSpiceRequest<ListCities> {

    private Location location;

    public CityJsonRequest(Location location) {
        super(ListCities.class);
        this.location = location;
    }

    @Override
    public ListCities loadDataFromNetwork() throws Exception {
        return getRestTemplate().
                getForObject("http://api.openweathermap.org/data/2.5/find?lat=" + location.getLatitude() +
                        "&lon=" + location.getLongitude() +
                        "&cnt=100&type=json",
                        ListCities.class);
    }

}




Java Source Code List

com.ruenzuo.weatherapp.activities.CitiesActivity.java
com.ruenzuo.weatherapp.activities.CitiesActivity.java
com.ruenzuo.weatherapp.activities.CityActivity.java
com.ruenzuo.weatherapp.activities.CityActivity.java
com.ruenzuo.weatherapp.adapters.CitiesAdapter.java
com.ruenzuo.weatherapp.adapters.CityAdapter.java
com.ruenzuo.weatherapp.base.CitiesBaseActivity.java
com.ruenzuo.weatherapp.base.CityBaseActivity.java
com.ruenzuo.weatherapp.fragments.CitiesListFragment.java
com.ruenzuo.weatherapp.fragments.CityFragment.java
com.ruenzuo.weatherapp.pojos.City.java
com.ruenzuo.weatherapp.pojos.Coordinate.java
com.ruenzuo.weatherapp.pojos.Forecast.java
com.ruenzuo.weatherapp.pojos.ListCities.java
com.ruenzuo.weatherapp.requests.CityJsonRequest.java
com.ruenzuo.weatherapp.test.CitiesActivityFunctionalTests.java
com.ruenzuo.weatherapp.test.CityActivityFunctionalTests.java