25,980
社区成员




http://wthrcdn.etouch.cn/weather_mini?citykey=101280601
, 来获取相应城市的天气预报情况, 然后显示出来.
InputStream in = response.getEntity().getContent();
public static String uncompress(InputStream in) throws IOException {
if (in== null) {
return "";
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
GZIPInputStream gunzip = new GZIPInputStream(in);
byte[] buffer = new byte[256];
int n;
while ((n = gunzip.read(buffer)) >= 0) {
out.write(buffer, 0, n);
}
out.flush();
out.close()
return out.toString("utf-8");
}