android 开发之解析XML文件
2010-07-01 15:18:00 来源:WEB开发网< low data="24"/>
< high data="28"/>
< icon data="/ig/images/weather/chance_of_rain.gif"/>
< condition data="可能有雨"/>
< /forecast_conditions>
< forecast_conditions>
< day_of_week data="周三"/>
< low data="25"/>
< high data="30"/>
< icon data="/ig/images/weather/chance_of_rain.gif"/>
< condition data="可能有雨"/>
< /forecast_conditions>
< /weather>
< /xml_api_reply>
我们用两个对象来存储XML返回的结果,如下所示:
package com.ideasandroid.mbt.vo;
import java.io.Serializable;
import java.util.List;
/**
* @author "IdeasAndroid示例代码"
* 天气对象
*/
public class GoogleWeather implements Serializable{
private static final long serialVersionUID = 1L;
private String condition;
private String tempF;
private String tempC;
private String humidity;
private String icon;
private String windCondition;
private List
public String getCondition() {
return condition;
}
public void setCondition(String condition) {
this.condition = condition;
}
public String getTempF() {
return tempF;
}
public void setTempF(String tempF) {
this.tempF = tempF;
}
public String getTempC() {
return tempC;
}
public void setTempC(String tempC) {
this.tempC = tempC;
}
public String getHumidity() {
return humidity;
}
public void setHumidity(String humidity) {
更多精彩
赞助商链接