Back to project page Common-Library.
The source code is released under:
Apache License
If you think the Android project Common-Library listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.morgan.library.net; /*from w w w . j a v a 2 s .com*/ import java.util.HashMap; import java.util.Map; import com.morgan.library.model.NetResult; import com.morgan.library.model.Weather; import com.morgan.library.utils.HttpClientUtils; import com.morgan.library.utils.StrUtils; /** * ???????????? * * @author Morgan.Ji * */ public class ApiClient implements IApiClient { @Override public NetResult<Weather> getWeather(double lat, double lon) { Map<String, Object> map = new HashMap<String, Object>(); map.put("lat", lat); map.put("lon", lon); String url = StrUtils.encodeUrl(ApiUrl.GET_WEATHER_API, map); NetResult<Weather> result = new NetResult<Weather>( HttpClientUtils.get(url)); if (result.isSuccess()) { JsonUtils.JsonToWeather(result); } return result; } }