设为首页 加入收藏

TOP

Android开发之Google天气显示(综合例子)(二)
2014-11-24 12:42:42 来源: 作者: 【 】 浏览:3
Tags:Android 开发 Google 天气 显示 综合 例子
n_current_conditions = true;
} else if (localName.equals("forecast_conditions")) {
this.in_forecast_conditions = true;
} else {
String dataAttribute = atts.getValue("data");
// 'Inner' Tags of ""
if (localName.equals("city")) {
} else if (localName.equals("postal_code")) {
} else if (localName.equals("latitude_e6")) {
/* One could use this to convert city-name to Lat/Long. */
} else if (localName.equals("longitude_e6")) {
/* One could use this to convert city-name to Lat/Long. */
} else if (localName.equals("forecast_date")) {
} else if (localName.equals("current_date_time")) {
} else if (localName.equals("unit_system")) {
if (dataAttribute.equals("SI"))
this.usingSITemperature = true;
}
// SHARED(!) 'Inner' Tags within "" AND
// ""
else if (localName.equals("day_of_week")) {
if (this.in_current_conditions) {
//可扩展
} else if (this.in_forecast_conditions) {
//可扩展
}
} else if (localName.equals("icon")) {
if (this.in_current_conditions) {
this.setIconURL(dataAttribute);
} else if (this.in_forecast_conditions) {
//可扩展
}
} else if (localName.equals("condition")) {
if (this.in_current_conditions) {
this.setCurrentCondition(dataAttribute);
} else if (this.in_forecast_conditions) {
//可扩展
}
}
// 'Inner' Tags within ""
else if (localName.equals("temp_f")) {
//this.setCurrentTemp(Integer.parseInt(dataAttribute));
} else if (localName.equals("temp_c")) {
this.setCurrentTemp(Integer.parseInt(dataAttribute));
} else if (localName.equals("humidity")) {
this.setCurrentHum(dataAttribute);
} else if (localName.equals("wind_condition")) {
//可扩展
}
// 'Inner' Tags within ""
else if (localName.equals("low")) {
int temp = Integer.parseInt(dataAttribute);
if (this.usingSITemperature) {
//可扩展
} else {
//可扩展
}
} else if (localName.equals("high")) {
//int temp = Integer.parseInt(dataAttribute);
if (this.usingSITemperature) {
//可扩展
} else {
//可扩展
}
}
}
}


@Override
public void endElement(String namespaceURI, String localName, String qName)
throws SAXException {
if (localName.equals("forecast_information")) {
this.in_forecast_information = false;
} else if (localName.equals(

首页 上一页 1 2 3 下一页 尾页 2/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Android系统移植 下一篇android开发之读取xml文件

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·C++中智能指针的性能 (2025-12-25 03:49:29)
·如何用智能指针实现c (2025-12-25 03:49:27)
·如何在 C 语言中管理 (2025-12-25 03:20:14)
·C语言和内存管理有什 (2025-12-25 03:20:11)
·为什么C语言从不被淘 (2025-12-25 03:20:08)