WEB开发网
开发学院手机开发Android 开发 android 开发之解析XML文件 阅读

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=&quo

< 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 forecastConditions;

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) {

上一页  1 2 3 4 5 6  下一页

Tags:android 开发 解析

编辑录入:coldstar [复制链接] [打 印]
赞助商链接